Skip to main content
Filter by
Sorted by
Tagged with
Advice
0 votes
4 replies
62 views

I am trying to move to RTK Query, but am struggling with one thing - how to access React Context. I currently am using custom hooks to query a back end. Depending on the environment (dev, uat, prod), ...
vegemite4me's user avatar
  • 6,956
0 votes
1 answer
77 views

import { createContext, useContext, useState, useEffect } from 'react'; import { Appearance } from 'react-native'; import { lightTheme, darkTheme } from '../utility/theme'; type ThemeType = typeof ...
Sagar Sharma's user avatar
0 votes
0 answers
40 views

if I login with wrong username or password the server (NextJS) will return error message with status code 401, what should happen in this case is that !res.success will be executed and it's indeed ...
Morgana Freeman's user avatar
0 votes
1 answer
80 views

When I make a component that relies on something like the currently chosen language for example, or maybe a special query function to fetch data, and I provide either of these things via a ...
ADJenks's user avatar
  • 3,462
0 votes
1 answer
51 views

I need to save the ID of a field from the settings.tsx view. That value need to be used with other view, like stations.tsx, alarms.tsx, map.tsx. If later, I need to watch another field, I can change ...
popof's user avatar
  • 11
1 vote
1 answer
76 views

Although the docs for context say "React automatically re-renders all the children that use a particular context starting from the provider that receives a different value.", from my testing ...
Drew Gallagher's user avatar
2 votes
1 answer
74 views

In my React Native app, I'm having a problem where the setState function is not being recognized as a function. I already inserted the context provider on the App root page and exported the context ...
Vivantt's user avatar
  • 43
1 vote
1 answer
75 views

I'm working on a complex analytics dashboard built with React and TypeScript, which involves multiple nested components. I'm using a combination of state management techniques including React Context, ...
Daniel James's user avatar
-1 votes
1 answer
46 views

I created an auth context and set the object to an initial state, then after wrapping the App() with the provider, I am trying to modify the authContext in 1 (Home.js) component and then try to access ...
omar watad's user avatar
0 votes
0 answers
142 views

I'm using import react-oidc-context to auth with my aws cognito. I'm trying to use the .signinPopup function but whenever the pop up opens I'm getting an error "Popup closed by user" ...
Totah's user avatar
  • 1
-1 votes
2 answers
182 views

Original Question I am trying to learn more about the inner workings of React, and here specifically Context Providers so I don't have a use-case in mind, just trying to understand why it works the ...
culicidae's user avatar
0 votes
0 answers
77 views

I've created an app that stores user information in firebase. The main profile page consumes the data via a hook that retrieves the data from firebase/storage. What I'm trying to do in this page is ...
D.Hodges's user avatar
  • 2,119
0 votes
1 answer
115 views

I'm attempting to fetch the data from user once the page loads. Although, currently when there is any route changes, it triggers my useEffect and calls the fetch user endpoint which causes my loading ...
Nilton Schumacher F's user avatar
1 vote
0 answers
47 views

I'm working on a framework that allows developers to create extensions for a main app. Extensions can add components to different parts of the app layout, such as the sidebar or workspace, ...
Ritesh Shakya's user avatar
0 votes
1 answer
31 views

I created a NewsContext for my React project for accessting static data: NewsContext: "use client"; import { createContext, useContext, useState, useEffect } from "react"; export ...
Lvkas_'s user avatar
  • 23
0 votes
1 answer
92 views

Description I encountered a problem while using the Next.js App Router (version 14.2.6). The issue occurs only in the production environment. it works perfectly fine in the local environment. I'm ...
D uuu's user avatar
  • 1
0 votes
0 answers
86 views

I have an Electron-Vite React (TSX) application. I am pretty new to coding Electron-Vite-React; perhaps my problem is because I am not understanding all the subtilities of certains concepts... I have ...
Alexandre Landry's user avatar
0 votes
1 answer
54 views

I want to fetch the data by running the API in the useContext() api, basically this API gives me the number of items added in the cart and I need that number only which Im using it in Cart.js ...
Mohit's user avatar
  • 137
-3 votes
1 answer
52 views

I've been out of the frontend js scene for a while, and now try to catch up on React etc. I don't really get contexts. First you need to create a context somewhere, then you can use <Context....
tonsteri's user avatar
  • 857
1 vote
1 answer
35 views

I need to use attendance data often on my website, So I make it as utility as below: import React, { useState, useEffect, useMemo, useCallback, createContext } from 'react'; import { ...
BI IYI's user avatar
  • 11
2 votes
2 answers
78 views

I am trying to create a parent/overarching context. The purpose of the context is to store UserInfo which should then be available to all children. UserInfo is set by getting config from an API. ...
Oam Psy's user avatar
  • 8,663
3 votes
0 answers
445 views

Playing with a store in Next.js 15 and using React 19 I'm running into an issue with my cart context and keep receiving a hydration error of: An optimistic state update occurred outside a transition ...
GʀᴜᴍᴘʏCᴀᴛ's user avatar
-1 votes
1 answer
45 views

I'm trying to write and context to set an id in local storage . Here's my code import React, { createContext, useEffect, useMemo, useState, ReactNode, } from 'react'; // Interface pour le ...
ikiou's user avatar
  • 1
0 votes
4 answers
102 views

I'm trying to create a context whose default value will come from an external source. I would need to do something similar to doing the fetch outside of an asynchronous function (I don't think this is ...
Thiago Barboza's user avatar
1 vote
2 answers
158 views

I am trying to implement dual theme (dark & light) in Next JS using MUI using use context method. It gives me this error: ⨯ src\app\page.tsx (6:50) @ useThemeContext ⨯ TypeError: (0 , ...
Muhammad Sharjeel Maqsood's user avatar

1
2 3 4 5
73