I am trying to update a counter with clicking on a add button so I am passing the data though cart context and reading it to update my counter but the ...
I am trying to update a counter with clicking on a add button so I am passing the data though cart context and reading it to update my counter but the ...
there is a simple codesandbox example [https://codesandbox.io/s/red-butterfly-kz13ee?file=/src/userName.jsx:0-270][1] I have two components first one ...
I am learning how to create a React reducer to be used in a React context. Can someone explain why the instructor created the {currentUser: null} obj ...
I'm creating a context that allows child components to setTheme. But the context when imported and used by useContext returned the default value inste ...
In this page the user can login, but if the untilDate is bigger than the current date it should log out the user. The code runs fine 1/2 times, the ot ...
i am creating a context to use Mobx store in my React application, by following the example: and in components is used by example: and there are ...
I'm trying to change the state of a parent component from a child component. My Component structure is basically like this. My Nav, in turn has sev ...
Lets say I have a basic setup for checking whether a user is logged in or not: In my App.tsx I want to create a useState hook so that I can manage ...
It's just a simple createContext and useContext code. I struggled a lot until I realised that an if statement is necessary in the useTodoContext funct ...
I'm trying to use React's Context API as well as Hooks with fetching data. I'm coding [createContext] like below, but it doesn't work. And here're ...
I am having a problem i can't seem to understand why is happening since i have the same example working in codesandbox, but in my app it shows a diffe ...
I am refactoring to TypeScript a tutorial in ReactJS that I am following. For the most part, the tutorial teaches you how to refactor most of the code ...
Starting with ReactJS and NextJS I have the following Layout component and using context to set values from the children component And the Login p ...
This is my first time using the React context hooks in an app and my context default value keeps appearing as "undefined." Troubleshooting so far: ...
Instead of passing props from parent to child1(parent of child2) ->to child2, I want to use createContext and receive the value with useContext. W ...
I am looking to conditionally call useContext. This is my original code, which runs correctly, but fails tslint. Component that calls useResourceScop ...
I am not being able to assign the state and setState to the value parameter of ContextProvider Code:- The Exact Error :- I want to pass the sta ...
I'm trying to build a small Cesium app with React that can zoom to various places on the globe by clicking a button associated with each location. I'm ...
I'm learning to use context with React native, actually i'm following a blog where define how use createContext and useContext for Authentication logi ...
Major EDIT I have quite huge object which is 3 level deep. I use it as a template to generate components on the page and to store the values which la ...