From 71c3a19635d989f1ed99119bf230856d9faeef21 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 20 Feb 2017 16:31:54 +0800 Subject: Fix controlled open --- examples/open.html | 0 examples/open.js | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 examples/open.html create mode 100644 examples/open.js (limited to 'examples') diff --git a/examples/open.html b/examples/open.html new file mode 100644 index 0000000..e69de29 diff --git a/examples/open.js b/examples/open.js new file mode 100644 index 0000000..5a0d1ed --- /dev/null +++ b/examples/open.js @@ -0,0 +1,36 @@ +/* eslint no-console:0 */ + +import 'rc-time-picker/assets/index.less'; + +import React from 'react'; +import ReactDom from 'react-dom'; +import TimePicker from 'rc-time-picker'; + +const App = React.createClass({ + getInitialState() { + return { + open: false, + }; + }, + toggleOpen() { + this.setState({ + open: !this.state.open, + }); + }, + setOpen({ open }) { + this.setState({ open }); + }, + render() { + return ( +
+ + +
+ ); + }, +}); + +ReactDom.render( + , + document.getElementById('__react-content') +); -- cgit v1.2.3