close
Skip to main content
Filter by
Sorted by
Tagged with
Best practices
2 votes
11 replies
264 views

In the following code I have a header, which is being used in a Route Layout called RootLayout.tsx which is a parent root to my whole application. First I implemented the scroll hiding mechanics, and ...
Debabrata Adhikari's user avatar
1 vote
3 answers
126 views

I have a category page that is supposed to display category info depending on the category route. My route is: <Route path="/category/*" element={<CategoryPage />} /> I can have ...
Paddy Hallihan's user avatar
-1 votes
2 answers
129 views

How do I render a div in a component conditionally based on a component property and the get a reference to that div when it's available? In this simplified example, the message displayed in the div ...
JustAnotherCoder894's user avatar
-1 votes
1 answer
138 views

I haven't found an official stance in React regarding what to do if you need to check whether a component has been mounted for certain actions (especially since this component might be used in ...
Denis Kramarenko's user avatar
Best practices
0 votes
5 replies
107 views

I am using useEffect with an empty dependency array , but it runs more than once, my goal is to fetch data from API only when component mounts. why does this happen in React and how can i ensure the ...
Shridhar k's user avatar
6 votes
1 answer
82 views

I'm working on a React table where each row has a dropdown with actions (Edit, Delete). I want to optimize performance using useMemo, but I'm stuck because each row needs a different path based on the ...
EmreLutfi's user avatar
1 vote
1 answer
3k views

I get the warning "Calling setState synchronously within an effect can trigger cascading renders" for my useEffect: useEffect(() => { if (positionData.length > 0) { const ...
macbas's user avatar
  • 41
0 votes
1 answer
83 views

I am learning React and was setting up a component that makes usage of useEffect and there is one case that I don't understand so I set up this minimum reproducible example: App.js: import { useState }...
Mohamed Badis Kerdellou's user avatar
0 votes
0 answers
77 views

I have a signature canvas on a form. When the form loads an existing report, it may already have signature data to load. In that case, in a useEffect, I call fromData on the signature component to ...
lmat - Reinstate Monica's user avatar
0 votes
1 answer
208 views

I have a page that on load, executes the following effect to retrieve data from a server const nav = useNavigation(); const loc = useLocation(); const [card, setCard] = useReducer(statefn, ...
GPorubanTKK's user avatar
2 votes
1 answer
226 views

i’m building a small AI chat ui in react (next.js app router, react 18) that streams tokens from my backend (openai style stream). basic flow: user types a prompt i push the user message into ...
Eli's user avatar
  • 77
Best practices
0 votes
2 replies
110 views

I am planning to implement pagination into my project for my data from Supabase, I had the idea that since there are different parameters (such as search text, page number, filter) that I should use ...
1million_ naira's user avatar
Best practices
0 votes
2 replies
711 views

I have been exploring the useTransition() hook and the startTransition() method provided by React with version 18+. The documentation states that we can de-prioritize state updates using them so that ...
midhun lc's user avatar
4 votes
1 answer
106 views

I have a modal. This modal opens after a user uploads a CSV. They can then make changes to the entries or delete them. The user can Confirm & Continue (go to next page, modal closes) or Upload New ...
npfist's user avatar
  • 167
3 votes
1 answer
202 views

I'm building a collaborative task management app using React 19's useOptimistic hook. Multiple users can update task properties (status, priority, assignee) simultaneously. I'm running into race ...
Gnaneshwar P's user avatar

15 30 50 per page
1
2 3 4 5
2581