Here is my app code:
const [myState, setMyState] = useState(() => { return { flag1: false, flag2: false } }) useEffect(() => {