mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 20:19:44 +08:00
update LocaleProvider demo
This commit is contained in:
parent
3582f46347
commit
37b1ed16b3
@ -107,7 +107,6 @@ class Page extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
let forceRerender = 0;
|
||||
class App extends React.Component {
|
||||
constructor() {
|
||||
super();
|
||||
@ -127,6 +126,7 @@ class App extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { locale = {} } = this.state;
|
||||
return (
|
||||
<div>
|
||||
<div className="change-locale">
|
||||
@ -136,8 +136,8 @@ class App extends React.Component {
|
||||
<Radio.Button key="cn" value={zhCN}>中文</Radio.Button>
|
||||
</Radio.Group>
|
||||
</div>
|
||||
<LocaleProvider locale={this.state.locale}>
|
||||
<Page key={forceRerender++ /* HACK: just refresh in production environment */} />
|
||||
<LocaleProvider locale={locale}>
|
||||
<Page key={locale.locale || 'en'/* Have to refresh for production environment */} />
|
||||
</LocaleProvider>
|
||||
</div>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user