From ad721111a43b805f503f9308bcec1860811530c5 Mon Sep 17 00:00:00 2001 From: Open Next Date: Tue, 17 Apr 2018 16:49:11 +0800 Subject: [PATCH] fix bug in getting-started - date is null when clear the DatePick (#10111) --- docs/react/getting-started.en-US.md | 4 ++-- docs/react/getting-started.zh-CN.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 docs/react/getting-started.en-US.md mode change 100644 => 100755 docs/react/getting-started.zh-CN.md diff --git a/docs/react/getting-started.en-US.md b/docs/react/getting-started.en-US.md old mode 100644 new mode 100755 index d8ba9418c1..3fb6d6bc86 --- a/docs/react/getting-started.en-US.md +++ b/docs/react/getting-started.en-US.md @@ -79,7 +79,7 @@ class App extends React.Component { }; } handleChange(date) { - message.info('Selected Date: ' + date.toString()); + message.info('Selected Date: ' + (date ? date.toString() : '')); this.setState({ date }); } render() { @@ -87,7 +87,7 @@ class App extends React.Component {
this.handleChange(value)} /> -
Date: {this.state.date.toString()}
+
Date: {this.state.date && this.state.date.toString()}
); diff --git a/docs/react/getting-started.zh-CN.md b/docs/react/getting-started.zh-CN.md old mode 100644 new mode 100755 index 2740284c72..a49cfc31d0 --- a/docs/react/getting-started.zh-CN.md +++ b/docs/react/getting-started.zh-CN.md @@ -81,7 +81,7 @@ class App extends React.Component { }; } handleChange(date) { - message.info('您选择的日期是: ' + date.toString()); + message.info('您选择的日期是: ' + (date ? date.toString() : '')); this.setState({ date }); } render() { @@ -89,7 +89,7 @@ class App extends React.Component {
this.handleChange(value)} /> -
当前日期:{this.state.date.toString()}
+
当前日期:{this.state.date && this.state.date.toString()}
);