score:4
Accepted answer
I heard from a clever friend of mine that the problem is because React contexts are defined at the module-level, and so since you tried to have your contexts in separate entrypoints, things will not go so well.
I think you can try making an index.js file that re-imports and exports everything, and then things should work as it's all consolidated in one module.
Source: stackoverflow.com
Related Query
- React context from library not updating in consumer
- React Context API not working from custom NPM component library
- Updating react context from consumer componentDidMount causes infinite re-renders
- How to get the data from React Context Consumer outside the render
- React Context api - Consumer Does Not re-render after context changed
- React context not updating
- React context useReducer is not updating correctly
- React state not reactive when triggered from outside library
- Updating Context from a Nested Component is not Working
- "TypeError: react.useContext is not a function" when mocking context Providers with React Testing Library
- Axios not updating state from API in function called on Click, but works on identical function on Component Mount in React
- React Context not updating for class as value
- React is not updating the UI after receiveing data from the API call (using hooks)
- React hooks not returning updated state values inside callback function from library events (FabricJS)
- React hooks not working when imported from local library
- React component not updating from props
- React context (hooks) not updating all references
- Access and modify react context from jest test with react testing library
- React Hooks Auth0-js Context Hook Not Updating
- React Context Consumer does not update (but Provider does)
- React Context "Property 'state' does not exist" when using useContext() on Context consumer
- Issue with async value for React context not available from child component
- State not updating on removing value from array in React JSX funcntional component
- React - changing state not updating elements rendered from variable
- React Context is not updating and returning initial value
- React Redux store not updating on delete of an item from state
- React context : state flow broken from Provider to Consumer
- React Context with Multiple State Values not updating initial values
- React components not rendering from global state using context API
- The react context from the child does not change
More Query from same tag
- Cors proxy issues within server.js file(react, express,sql)
- React Router v4 dynamic redirect initial load
- React.js Iterate JSON and insert Card components based on ID count in the array
- How to set today date as a default date in antd?
- How to get data from response if you receive an error?
- Error: It looks like you called `mount()` without a global document being loaded
- API Call Returns Data But Not Render
- How to store the page number in ReactJS (not in state) to construct the GET URL with page number from 1 to 5
- React-Router v4 onEnter replacement
- Material-UI TextField variant label striking through value
- How to use material-ui TextField with react-phone-number-input
- Displaying popover after clicking on an event in react-big-calendar
- How to get params from url with React front end and express backend?
- Write standalone React.PropTypes.any.isRequired
- RelayJS: How to set initialVariables via props
- React - prevent calling useEffect for the first mount
- this.props.children returns null in react-router
- Using React and Redux, how would you clear an input field after a successful redux-thunk completion?
- How do I edit or import CSS in React?
- when Component is re-rendered, is the function object deleted completely and re-created?
- Send values from inputs in react (change querySelector(id) to react)
- How do I invoke a function with the new value set from setState in useEffect?
- React setState does not change the state
- React button not rerendering the component
- Is it compulsory to use <Route> only inside of App.js? throwing error like "Error: Invariant failed: You should not use <Link> outside a <Router>"
- how to stop wrapped components being spaced
- Webpack and Karma Testing: Uncaught ReferenceError: jQuery is not defined using
- Use maxResults from Youtube v3 APIs on React
- Javascript working before page rendering in Gatsby
- routing issue in reactjs where the matchUrl is coming from parent component