type: fix demo types error (#39059)

This commit is contained in:
lijianan 2022-11-28 21:38:36 +08:00 committed by GitHub
parent 4efa3b2896
commit 0a004930d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,13 +1,13 @@
import React, { useState } from 'react';
import { Segmented } from 'antd';
const Demo = () => {
const [foo, setFoo] = useState('AND');
const Demo: React.FC = () => {
const [foo, setFoo] = useState<string | number>('AND');
return (
<>
<Segmented value={foo} options={['AND', 'OR', 'NOT']} onChange={setFoo} />
&nbsp;&nbsp;
<Segmented value={foo} options={['AND', 'OR', 'NOT']} onChange={(value) => setFoo(value)} />
<Segmented value={foo} options={['AND', 'OR', 'NOT']} onChange={setFoo} />
</>
);
};