From fcf9bafb1814c0a05702c921a67cefa7cca4a262 Mon Sep 17 00:00:00 2001 From: bang Date: Sun, 19 Feb 2017 19:51:40 +0700 Subject: [PATCH] docs: Rewrite Transfer demos to ES6 component --- components/transfer/demo/advanced.md | 30 ++++++++++++------------- components/transfer/demo/basic.md | 27 +++++++++++----------- components/transfer/demo/custom-item.md | 30 ++++++++++++------------- components/transfer/demo/large-data.md | 26 ++++++++++----------- components/transfer/demo/search.md | 30 ++++++++++++------------- 5 files changed, 68 insertions(+), 75 deletions(-) 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 (