Top "React-context" questions

React Context provides a way to pass data through the component tree without having to pass props down manually at every level.

How to get the data from React Context Consumer outside the render

I am using the new React Context API and I need to get the Consumer data from the Context.Consumer …

reactjs react-context
How to change React context programmatically?

I'm trying to use the new React context to hold data about the logged-in user. To do that, I create …

javascript reactjs authentication react-context
Cannot read property 'history' of undefined (useHistory hook of React Router 5)

I am using the new useHistory hook of React Router, which came out a few weeks ago. My React-router version …

reactjs react-router react-hooks react-router-dom react-context
React Context api - Consumer Does Not re-render after context changed

I searched for an answer but could not find any, so I am asking here, I have a consumer that …

javascript reactjs typescript react-context
How to use useNavigation() within @react-navigation drawer?

Current Behavior I have a react-native application that use react-navigation v5 for the routing. I have a drawer (offeset menu …

javascript reactjs react-native react-navigation react-context
React context with hooks prevent re render

I use React context with hooks as a state manager for my React app. Every time the value changes in …

javascript reactjs react-native react-context
How should the new context api work with React Native navigator?

I created a multiscreen app using React Navigator following this example: import { createStackNavigator, } from 'react-navigation'; const App = createStackNavigator({ Home: { screen: …

reactjs react-native react-navigation react-context
React useContext returns undefined

I'm trying to use React Context to manage states for my project, but I can't seem to make it work …

reactjs react-hooks react-context
how to implement the new react-redux v6.0.0

i was trying to migrate react-redux v5.X.X to v6.0.0 and there dosent seem to be any documentation for …

javascript reactjs react-redux react-context
React context not updating

I have set a basic sample project that use Context to store the page title, but when I set it …

javascript reactjs react-context