Category "react-context"

Access context outside render tree

I have an app in React Native that uses many context. I want to access one of them within a non rendering function e.g. : const DataContext = React.createContex

When I wrap the index.js with my context provider I just see a blank page

When I wrap the index.js with my context provider I just see a blank page. this is my context import React, { createContext, Fragment, useState } from 'react';

PWA with React: Trying to create a object that updates every second and is accessible for many components

I'm currently working on a PWA build with React. I'm looking for a way to create one object which contains information like the current time (incl. seconds), cu

"No overload matches this call" error when setting up ContextApi & useReducer using Typescript

I trying to set up ContextApi & useReducer with typescript. On my "issuesInitialState" variable in useReducer, I get the error: No overload matches this ca

Why use Context API when we can use a static variable?

I am getting start to study Context API of the React Native. I understand that the Context API is to solve the problem to send a lot of props in the parameters.

dom is not updated after state change via Context API

I am quite new to React and tried to finish a project on FrontendMentor. It's basically a simple OPA of an online store with just one product and the ability to

Why Context API is worse than Redux for high frequency updates?

I saw many articles that Redux is better than Context API in performance than high frequency updates, but nothing is specific and tell why. What makes people sa

Why isn't my React context being updated?

When I use the app and navigate to the SetContext component, I see the value of auth is correct ("dummy value") and after entering a value in the edit field and

Protected routes not accessible even after signing or logging in

I am making a site whereby after the user signs in, the user is meant to be redirected to the home page. The homepage and all the other pages of the site are on

React showing a blank screen without any error messages (context api used)

I'm building a react Amazon clone, so in order to give the user the ability to add a product into his basket (as the first version of all the future checkout sy

Context API using the initial value not the one set in UseState

I just started using typescript with react and tried to deal with ContextAPI with the typescript. So Far I've set a context and tried to use a provider inside m

Why isn't necessary the contextAPI in that case?

I thought that if I want to pass a state in another component, it is possible only through props or with contextAPI (provider etc). For example: import { create

How to mock a single value in a React Context provider while keeping the rest of values

Hi I have a context provider which returns like this: return ( <RepeatsSidebarContext.Provider value={{ loading,

RN Web + Firebase: snapshot listeners unsubscribe in unmount vs in global unmount (using context)

In short: which is most memory + cost efficient way to use Firestore snapshot listeners, unmount them always at screen unmount or have the unsubscribe function

React Native Context rendering a blank screen when wrapped inside <Provider>

I'm trying to build a simple blog native app using context and have stumbled upon an issue to which I can't find a root to. Here's the structure of it: /context

React context between microfrontends

TLDR; How to use a single context between react micro frontends? The application is divided into multiple Microfrontends or react apps. Each of these is running