diff --git a/components/affix/demo/target.md b/components/affix/demo/target.md index 52bbc6d71d..d78ab9100e 100644 --- a/components/affix/demo/target.md +++ b/components/affix/demo/target.md @@ -16,36 +16,32 @@ Set a `target` for 'Affix', which is listen to scroll event of target element (d ````jsx import { Affix, Button } from 'antd'; -const Demo = () => { - return ( -
-
+class Demo extends React.Component { + render() { + return ( +
{ this.container = node; }}>
-
-
-
- document.getElementById('scrollable-container')} offsetTop={20}> - + this.container}> +
-
- ); -}; + ); + } +} ReactDOM.render(, mountNode); ````