You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically I have a error handler to check for the default value of the context in hooks.jsx, like this:
exportfunctionuseCounter(){constvalue=useContext(CounterContext);if(!value){thrownewError("useCounter must be used within a CounterContext.Provider ",);}returnvalue;}
Steps to Reproduce the Bug or Issue
Change the source code, (eg. comment) in the context.jsx then the error:
Uncaught (in promise) Error: useCounter must be used within a CounterContext.Provider
at useCounter (hooks.jsx:7:11)
....
appears in the console. Have to refresh the page to remove the error.
Expected behavior
The error shouldn't appear in dev mode.
Screenshots or Videos
No response
Platform
OS: [e.g. macOS, Windows, Linux]
Browser: [e.g. Chrome, Safari, Firefox]
Version: [e.g. 91.1]
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
the useContext get null value in dev mode. According to the documentation:
Your Example Website or App
https://stackblitz.com/edit/solidjs-templates-c5vdbu?file=src%2FContext.jsx
Basically I have a error handler to check for the default value of the context in hooks.jsx, like this:
Steps to Reproduce the Bug or Issue
Change the source code, (eg. comment) in the context.jsx then the error:
appears in the console. Have to refresh the page to remove the error.
Expected behavior
The error shouldn't appear in dev mode.
Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: