So i try to use Effect to passing the component from redux, here is my code:
const initState = { newAttribs: { ...props.state.Auth }, }; const [userList, setUserList] = useState(initState); useEffect(() => { setUserList({ ...userList, newAttribs: { ...props.state.Auth } }); }, [props.state.Auth]); console.log("userList now", userList); but it keeps geeting me warning like this in the console:
WARNING in [eslint] src\pages\Login.jsx Line 15:6: React Hook useEffect has a missing dependency: 'userList'. Either include it or remove the dependency array. You can also do a functional update 'setUserList(u => ...)' if you only need 'userList' in the 'setUserList' call react-hooks/exhaustive-deps Can someone explained to me where did i do wrong here....