📌  相关文章
📜  在函数组件中使用 setstate - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:12.344000             🧑  作者: Mango

代码示例1
const App = () => {
  const [state, setState] = React.useState({ first: "hello", second: "world" });
  
  return (
    
setState({...state, first: ev.target.value})} /> setState({...state, second: ev.target.value})} />
) } ReactDOM.render(, document.getElementById('app'))