From 5b1086548164afd65cf4a5cbb7ec1f92cd5e2b9e Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 14 Apr 2017 17:22:58 +0800 Subject: Updates --- examples/value-and-defaultValue.html | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'examples/value-and-defaultValue.html') diff --git a/examples/value-and-defaultValue.html b/examples/value-and-defaultValue.html index ea2541e..88ab274 100644 --- a/examples/value-and-defaultValue.html +++ b/examples/value-and-defaultValue.html @@ -2,7 +2,7 @@ - value-and-defaultValue.js - example - rc-time-picker@2.3.3 + value-and-defaultValue.js - example - rc-time-picker@2.3.4 @@ -263,7 +263,7 @@ Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-lic
-

rc-time-picker@2.3.3

+

rc-time-picker@2.3.4

React TimePicker

@@ -278,21 +278,19 @@ Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-lic import moment from 'moment'; import TimePicker from 'rc-time-picker'; -const App = React.createClass({ - getInitialState() { - return { - value: moment(), - }; - }, - handleValueChange(value) { +class App extends React.Component { + state = { + value: moment(), + }; + handleValueChange = (value) => { console.log(value && value.format('HH:mm:ss')); this.setState({ value }); - }, - clear() { + } + clear = () => { this.setState({ value: undefined, }); - }, + } render() { return ( <div> @@ -307,8 +305,8 @@ Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-lic <button onClick={this.clear}>clear</button> </div> ); - }, -}); + } +} ReactDom.render( <App />, -- cgit v1.2.3