476,707 questions
-2
votes
1
answer
26
views
Getting each child in a list should have a unique "key" prop error [closed]
Each child in a list should have a unique "key" prop. Check the render method of div. It was passed a child from MenuBar.
<div className="flex items-center overflow-x-auto no-...
-1
votes
1
answer
25
views
React 19 Boiler plating
I am trying to create a custom boilerplate, For the routing part i am planning to use react-router. So for that I am confused whether I want to use declarative mode or data mode.
Please suggest which ...
2
votes
1
answer
38
views
Responsive Design using Chakra UI Show Component with When property
The newer Show component now has a when prop, but no longer has the above or below props. I'm trying to follow along with an exercise to use the Show component to display a grid item only on certain ...
-3
votes
1
answer
49
views
In React, why can't I use an object wrapper in state to allow mutating the data inside? [closed]
In React, if I have an array of data like [A, B, C], why not store it inside a wrapper object like { array: [A, B, C] }? then we can mutate the array directly (e.g., using .push()) and then create a ...
1
vote
1
answer
50
views
Piechart is not rendering proportionally
Why is this code not rendering the piechart proportionally? E.g. if the values are 2:4, it shows 2 as a thin line and the rest for the 4.
"use client";
function polarToCartesian(cx: number, ...
Best practices
1
vote
3
replies
67
views
How to keep a “global” React Error Boundary config but only show fallback locally?
I’m using a React Error Boundary and I understand that when an error is caught, React discards the subtree inside the nearest boundary and renders that boundary’s fallback.
Right now I have a single “...
-3
votes
0
answers
86
views
Why does useEffect placement relative to an “unreachable” early return change child component re-render behavior? [duplicate]
Nextjs 16, React 19.2, React Hook Form 7.6
I have encountered a very weird behavior of useEffect and unreachable early return. See here:
"use client";
import React, { useState, useEffect } ...
Best practices
2
votes
2
replies
68
views
Best Practices React Native Repositories
I'm building an React Native mobile app, so I'm searching for a repository to get as inspiration, because any video or repository I found didn't looks reliable enough to follow as a guide. I'm needing ...
-3
votes
0
answers
110
views
Why do useEffect and an early return affect child re-renders when using react hook form in React? [closed]
I have encountered a weird situation and I am pretty sure there is bug either in react-hook-form(7), React (19) or nextjs (16). Below details:
"use client";
import React, { useState, ...
1
vote
0
answers
70
views
Is React 18 with react-server-dom canary builds vulnerable to CVE-2025-55182?
I’m maintaining a React 18 project and I’m trying to assess the impact of CVE-2025-55182 (React Server Components/"React2Shell").
Most advisories mention affected versions in the React 19 ...
-3
votes
1
answer
37
views
React: Calculate dynamic "Shrink to Fit" (Contain) overlay coordinates for an image with different aspect ratios [closed]
I am building a photo printing UI in React where users select a physical print size (e.g., 6x4, 5x7) and need an overlay to represent the "Paper."
I need to implement a "Shrink to Fit&...
-3
votes
0
answers
64
views
Authorized routing issue in browserrouter in react [closed]
I have an issue with my router.tsx. The problem seems to be somewhere in the student layout, but I cannot figure out what is wrong.
As soon as I try to open localhost:5173/, it immediately checks ...
1
vote
1
answer
65
views
React Native video player getting resize in landscape mode
I am trying to create a react native video player using react native video library and when I switch to landscape mode by clicking on fullscreen icon video playing in landscape mode with full width ...
1
vote
1
answer
138
views
Calling setState synchronously within an effect can trigger cascading renders
I get the warning "Calling setState synchronously within an effect can trigger cascading renders" for my useEffect:
useEffect(() => {
if (positionData.length > 0) {
const ...
Best practices
0
votes
0
replies
58
views
Latest leaf selected in MantineUI Tree component
I'm trying to use MantineUI Tree component with very simple tree data:
const treeData: TreeNodeData[] = [
{
label: "parent 1",
value: "1",
children: [
...