Skip to content

Commit

Permalink
fix: delete useless keys to prevent page jitter caused by remounting …
Browse files Browse the repository at this point in the history
…component (#40327)

* fix: remove useless key

* fix
  • Loading branch information
li-jia-nan authored Jan 19, 2023
1 parent 1bcb251 commit 4cace76
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions components/config-provider/demo/locale.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ const App: React.FC = () => {
};

return (
<div>
<>
<div style={{ marginBottom: 16 }}>
<span style={{ marginRight: 16 }}>Change locale of components: </span>
<span style={{ marginRight: 16 }}>Change locale of components:</span>
<Radio.Group value={locale} onChange={changeLocale}>
<Radio.Button key="en" value={enUS}>
English
Expand All @@ -127,11 +127,9 @@ const App: React.FC = () => {
</Radio.Group>
</div>
<ConfigProvider locale={locale}>
<Page
key={locale ? locale.locale : 'en' /* Have to refresh for production environment */}
/>
<Page />
</ConfigProvider>
</div>
</>
);
};

Expand Down

0 comments on commit 4cace76

Please sign in to comment.