Enfield-li ā€“ 20-57 Jan 4

No sure what will possibly cause a simple problem like this: "can't access lexical declaration 'initialState' before initialization", can someone help me take a look the code, I am so cluless šŸ˜µā€šŸ’«
No description
UU
Unknown Userā€¢835d ago
E
Enfield-Liā€¢835d ago
I changed the const initialState to var
UU
Unknown Userā€¢835d ago
E
Enfield-Liā€¢835d ago
the problem it disapeared
UU
Unknown Userā€¢835d ago
E
Enfield-Liā€¢835d ago
that's the whole context page maybe somewhere I imported cause problem?
UU
Unknown Userā€¢835d ago
E
Enfield-Liā€¢835d ago
Ok, Let me check if that's the case šŸ˜ŗ
E
Enfield-Liā€¢835d ago
Could the set up of createContext cause this, because this is the only place I can use initialState..
No description
UU
Unknown Userā€¢835d ago
E
Enfield-Liā€¢835d ago
Ok, I will try set up a sandbox..
UU
Unknown Userā€¢835d ago
E
Enfield-Liā€¢835d ago
I don't understand what that means coolcry can you help me take a look at the code: https://codesandbox.io/s/zealous-bhaskara-lhi92
1076462153
CodeSandbox
zealous-bhaskara-lhi92 - CodeSandbox
zealous-bhaskara-lhi92 by 1076462153 using @testing-library/jest-dom, @testing-library/react, @testing-library/user-event, @types/jest, @types/node, @types/react, @types/react-dom, bootstrap, concurrently
E
Enfield-Liā€¢835d ago
Strange enough, code sandbox seems have no problem with it, but my local browser just completely broken because of it.. I have looked into some others' code, just found out that, simply moving the initialState to a different file and import it to relevant places, can solve the "circular dependency" problem. Thank you man, thank you for the hint @jcampuza šŸ˜ŗ
E
Enfield-Liā€¢835d ago
If it wasn't for the hint on that concept, these things makes no sense to me
UU
Unknown Userā€¢834d ago