react-context Questions

1

Solved

In this project I'm using React.createContext() methode to manage the state. I can access to the state data by importing the Context.Consumer and using this consumer in the return methode of the c...
Wendolynwendt asked 29/11, 2020 at 14:11

1

I want to make a call to get the user information and use it in different components throughout the application, so I am using react.Context and I managed to move a string around between components...
Britanybritches asked 15/11, 2020 at 4:43

3

I created a multiscreen app using React Navigator following this example: import { createStackNavigator, } from 'react-navigation'; const App = createStackNavigator({ Home: { screen: HomeScreen...
Tatar asked 5/7, 2018 at 9:16

5

MyContext.js import React from "react"; const MyContext = React.createContext('test'); export default MyContext; I created my context in a separated js file where I can access my ...
Shandra asked 24/5, 2018 at 6:44

3

Solved

I use React Context API to store the information that a user is authenticated. In development mode when I type in any URL that redirects to the 404 error page the context data is lost. When I navig...
Bravura asked 3/7, 2019 at 17:21

1

Solved

I'm using react and react hooks for front-end and I'm getting this error: index.js:1 Warning: Cannot update during an existing state transition (such as within `render`). Render methods should ...
Stevestevedore asked 11/10, 2020 at 17:22

1

Solved

In my react app, I am rendering different instances of <Item> Components and I want them to register/unregister in a Context depending if they are currently mounted or not. I am doing this wi...

1

Solved

I create a Context in React.js with TypeScript but this error had occurred: Cannot find namespace 'JobContext'.ts(2503) import React, { createContext, useState } from 'react'; export const JobCont...
Sectional asked 9/9, 2020 at 12:22

4

Solved

Current Behavior I have a react-native application that use react-navigation v5 for the routing. I have a drawer (offeset menu left) in all my views I use the stackNavigation for page transition...

2

I am trying to set up tests for my component App.js that takes in a context as a prop and returns a provider. The issue is when I am trying to test it, the context that I pass into it always resolv...
Hedonism asked 14/4, 2019 at 0:46

1

I am trying to access a react context values within the setContext function for my Apollo client. I would like to be able to dynamically update the header for each graphql request with the react co...
Delsiedelsman asked 8/12, 2019 at 3:11

1

Solved

I originally followed this project to add Firebase to a Gatsby React app. It involves making a Firebase context, wrapping a root layout with a provider, and then using a withFirebase HOC to wrap co...
Lungwort asked 5/8, 2020 at 14:58

1

Solved

Thanks in advance for helping with this question. Some Context (No Pun Intended) I'm working on a company's project that will restrict me from putting all the code on here, but I will try and put ...

2

I trying to set up ContextApi & useReducer with typescript. On my "issuesInitialState" variable in useReducer, I get the error: No overload matches this call. Overload 1 of 5, '(redu...
Danita asked 9/5, 2020 at 9:31

1

Solved

So an interesting and amazing property that Portals solve is preserving Context from a Provider even if your component needs to be rendered somewhere else. If you wrap a component subtree with a Co...
Monosaccharide asked 14/8, 2019 at 19:1

2

Solved

I have the following react class component to call an API every 10 seconds. Its works with no issues. class Alerts extends Component { constructor() { this.state = { alerts: {}, } } compone...

4

Solved

I am having an app in which I am using 3 Context Provider. For the app to work, I have to wrap <App/> in all these providers. As my app grows I am expecting to have a few more providers for m...
Bestride asked 8/3, 2020 at 18:30

1

Solved

I have some general questions which are bothering me regarding the context API and local storage. When to use local storage?, when to use the Context API and when would I use both? I know that to...
Dagan asked 30/5, 2020 at 17:1

1

Solved

I'm using React contexts in order to hold my authentication state for my application. Currently, I'm having an issue where whenever I try and hit /groups/:id, it always redirects me to /login first...

0

Solved Issue is tracked on github I was attempting to test custom hooks using the react testing library, and the hook I was trying to put under test requires multiple context providers to work corr...

4

Solved

I have an application where users will click various parts of the application and this will display some kind of configuration options in a drawer to the right. The solution I've got for this is ...
Anaximenes asked 9/4, 2020 at 3:7

2

Solved

Using the useContext hook with React 16.8+ works well. You can create a component, use the hook, and utilize the context values without any issues. What I'm not certain about is how to apply chang...
Sefton asked 17/2, 2019 at 23:31

4

Solved

I use React context with hooks as a state manager for my React app. Every time the value changes in the store, all the components re-render. Is there any way to prevent React component to re-rend...
Dockhand asked 14/7, 2019 at 18:20

1

I want to find a way to avoid unnecessary re-renders when using useContext. I've created a toy sandbox, which you can find here: https://codesandbox.io/s/eager-mclean-oupkx to demonstrate the probl...
Desuetude asked 14/4, 2020 at 3:4

3

Solved

I'm trying to migrate from Redux Store to use Apollo Client Cache that comes with Apollo Graphql Client. One of the key features that sets Apollo Client apart from other data management solutions...
Geometric asked 24/1, 2020 at 6:22

© 2022 - 2024 — McMap. All rights reserved.