--- order: 21 title: zh-CN: 聚焦 en-US: Focus --- ## zh-CN 聚焦额外配置属性。 ## en-US Focus with additional option. ```tsx import type { InputRef } from 'antd'; import { Button, Input, Space, Switch } from 'antd'; import React, { useRef, useState } from 'react'; const App: React.FC = () => { const inputRef = useRef(null); const [input, setInput] = useState(true); const sharedProps = { style: { width: '100%' }, defaultValue: 'Ant Design love you!', ref: inputRef, }; return ( { setInput(!input); }} />
{input ? : }
); }; export default App; ```