So I'm learning how to use React context, I have found this example which is very helpful: https://codesandbox.io/s/login-flow-w-react-context-api-p9j96?file=/src/Login/index.js
Since useSetState can no longer be used, I tried to import useState from react, but it doesn't work the same, useState only passing password to the login function, as can be seen here:
https://codesandbox.io/s/login-flow-w-react-context-api-forked-njs1kt?file=/src/Login/index.js
Console also threw this error:
A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component.
Anyway I can fix this? Thank you guys so much, and happy holiday!!