diff --git a/components/transfer/demo/advanced.md b/components/transfer/demo/advanced.md index e6178d35fa..3474f426ec 100644 --- a/components/transfer/demo/advanced.md +++ b/components/transfer/demo/advanced.md @@ -18,17 +18,15 @@ You can customize the labels of the transfer buttons, the width and height of th ````jsx import { Transfer, Button } from 'antd'; -const App = React.createClass({ - getInitialState() { - return { - mockData: [], - targetKeys: [], - }; - }, +class App extends React.Component { + state = { + mockData: [], + targetKeys: [], + } componentDidMount() { this.getMock(); - }, - getMock() { + } + getMock = () => { const targetKeys = []; const mockData = []; for (let i = 0; i < 20; i++) { @@ -44,11 +42,11 @@ const App = React.createClass({ mockData.push(data); } this.setState({ mockData, targetKeys }); - }, - handleChange(targetKeys) { + } + handleChange = (targetKeys) => { this.setState({ targetKeys }); - }, - renderFooter() { + } + renderFooter = () => { return (