docs: fix typo in demo (#26391)

* Update extra.md

* Update extra.md
This commit is contained in:
xishanxu 2020-08-26 11:09:14 +08:00 committed by GitHub
parent 73f4b9bcd7
commit 507fdc44ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,16 +30,16 @@ const OperationsSlot = {
const options = ['left', 'right'];
const Demo = () => {
const [positon, setPosition] = React.useState(['left', 'right']);
const [position, setPosition] = React.useState(['left', 'right']);
const slot = React.useMemo(() => {
if (positon.length === 0) return null;
if (position.length === 0) return null;
return positon.reduce(
(acc, direaction) => ({ ...acc, [direaction]: OperationsSlot[direaction] }),
return position.reduce(
(acc, direction) => ({ ...acc, [direction]: OperationsSlot[direction] }),
{},
);
}, [positon]);
}, [position]);
return (
<>
@ -61,7 +61,7 @@ const Demo = () => {
<Divider />
<CheckboxGroup
options={options}
value={positon}
value={position}
onChange={value => {
setPosition(value);
}}