📜  开关按钮反应值 - Javascript代码示例

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

代码示例1
import { Switch } from '@chakra-ui/react';

const defaultSwitchValue = true;
const [sameAddressSwitch, setSameAddressSwitch] = useState(defaultSwitchValue);

const handleSwitchOnChange = () => {
  const newValue = !sameAddressSwitch;
  setSameAddressSwitch(newValue);
};

return (
 
);