Closed aidanho1188 closed 8 months ago
Apparently, version 6.0 of react-router-dom changed a lot of methods. In this case we need to use "useNaviate" instead of "useHistory". I also learn about localStorage which is a property of the window interface (part of DOM). So we can use this instead of doing props drilling to access user information.
https://reactrouter.com/en/main/upgrading/v5#use-usenavigate-instead-of-usehistory
Successfully handle user login but fail to navigate to the next page. We need to pass the userId to the next page somehow. From what I read, we can use dispatch and history.push("/", userId) to transfer userId to the next page, not sure how to do it tho. We can either put a hold on this problem and merge the current code back into 32-auth-component, or keep this branch until it complete and then merge it.