import React from 'react'; import { Button, Flex, Splitter, Switch, Typography } from 'antd'; const renderDesc = (text: string) => ( {text} ); const App: React.FC = () => { const [sizes, setSizes] = React.useState<(number | string)[]>(['50%', '50%']); const [enabled, setEnabled] = React.useState(true); return ( { setSizes(nextSizes); }} > {renderDesc('First')} {renderDesc('Second')} { setEnabled(!enabled); }} checkedChildren="Enabled" unCheckedChildren="Disabled" /> ); }; export default App;