React Context with hooks not populating state in context
I have the following React 18 code:
React use hooks (useContext) inside of useReducer
I have a reducer inside useContext/provider. I need to validate an action using values from another Provider. Is there a way to retrieve those values from a Provider from within the useReducer hook? Or do I have to try to feed them in as function arguments. Ex:
Default Values vs. undefined in React TypeScript Context
In React with TypeScript, should we define default values for context, or should we allow the context value to be undefined?