From 6455bdf6e1af4944841c9fa1cb48ed5a53a618ac Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 20 Feb 2017 22:14:47 +0800 Subject: [PATCH] rewrite Pagination demos to es6 component, #4878 --- components/pagination/demo/controlled.md | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/components/pagination/demo/controlled.md b/components/pagination/demo/controlled.md index 4cb378b68e..be606e5e20 100644 --- a/components/pagination/demo/controlled.md +++ b/components/pagination/demo/controlled.md @@ -16,22 +16,20 @@ Controlled page number. ````jsx import { Pagination } from 'antd'; -const Container = React.createClass({ - getInitialState() { - return { - current: 3, - }; - }, - onChange(page) { +class App extends React.Component { + state = { + current: 3, + } + onChange = (page) => { console.log(page); this.setState({ current: page, }); - }, + } render() { return ; - }, -}); + } +} -ReactDOM.render(, mountNode); +ReactDOM.render(, mountNode); ````