Refactored all the application states to Zustand. This is required because the hook use to change the reference of action functions(Ex loadInitPaletteFromStore). This is causing issues in useEffect behavior. The reload after auth is failing because of this only.
The new zustand hook useApplicationState can be separated into smaller hooks later.
-I will start writing test case for hooks to add a safety net for state behavior.
Note: Also We have not added useEffect dependency at lot of places. We should be avoiding this because It can lead to unexpected issues. React official docs also recommend to do same ( https://www.npmjs.com/package/eslint-plugin-react-hooks ).
loadInitPaletteFromStore
). This is causing issues in useEffect behavior. The reload after auth is failing because of this only.Note: Also We have not added useEffect dependency at lot of places. We should be avoiding this because It can lead to unexpected issues. React official docs also recommend to do same ( https://www.npmjs.com/package/eslint-plugin-react-hooks ).