From c7c886fda6f46cbb4d550e92e3f1294d2af8b8f7 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 3 Dec 2016 16:19:22 +0800 Subject: [PATCH] Improve Affix target demo code style, close #4037 --- components/affix/demo/target.md | 30 +++++++++++++----------------- components/affix/index.tsx | 10 +++++++++- 2 files changed, 22 insertions(+), 18 deletions(-) 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); ````