demo: simplify demos (#45585)

This commit is contained in:
afc163 2023-10-30 15:02:00 +08:00 committed by GitHub
parent 31393135a0
commit 67c8e8b259
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -12,7 +12,6 @@ const content = (
const buttonWidth = 80;
const App: React.FC = () => {
const options = ['Show', 'Hide', 'Center'];
const [arrow, setArrow] = useState('Show');
const mergedArrow = useMemo(() => {
@ -36,7 +35,7 @@ const App: React.FC = () => {
}}
>
<Segmented
options={options}
options={['Show', 'Hide', 'Center']}
onChange={(val: string) => {
setArrow(val);
}}

View File

@ -6,7 +6,6 @@ const text = <span>prompt text</span>;
const buttonWidth = 80;
const App: React.FC = () => {
const options = ['Show', 'Hide', 'Center'];
const [arrow, setArrow] = useState('Show');
const mergedArrow = useMemo(() => {
@ -31,7 +30,7 @@ const App: React.FC = () => {
>
<Segmented
value={arrow}
options={options}
options={['Show', 'Hide', 'Center']}
onChange={(val: string) => {
setArrow(val);
}}