475,824 questions
Best practices
0
votes
6
replies
54
views
Render-looping when child and parent components both store state simultaneously
What is the best practice in React + TypeScript to prevent component render looping in the following scenario:
There is a standalone component (like an independent component from a library) ...
-1
votes
1
answer
59
views
React 19 useTransition behaves weirdly with multiple async updates to state [closed]
with startTransition React can now decide some updates are not a high priority and can choose to ignore rendering an older update if its taking too long and continue with the latest one.
eg. if we are ...
-1
votes
0
answers
65
views
React context in external package not saving state
I'm building an internal auth SDK that requires a configuration method to run before any of its other functionalities will work. I've put logs all over the place, and I've discovered that when I call ...
1
vote
0
answers
37
views
Add existing react app project in an empty Aspire project
In visual studio I've created an empty solution, then I've created a basic react app. It works.
Now I've created an emptyy aspire project and I want to add the react app to it so when I run the aspire ...
Advice
0
votes
1
replies
71
views
Comparison of React and Angular for Modern Web Development (2026)
Which framework is better for web development in 2026: React or Angular? I would like to know which one is more recommended in terms of performance, scalability, and ease of use for modern web ...
-2
votes
1
answer
127
views
ESLint "Cannot access refs during render" error but I am not accessing ref
I am trying to pass a ref to a custom function, but I'm getting an ESLint error on dialog.ref from the react-hooks/refs rule of eslint-plugin-react-hooks. I am not sure why because I am not accessing ...
-1
votes
0
answers
60
views
React form validation tests failing with React Testing Library – expected 2 children but received 1
I am working on a React component that implements a form with validation logic. The form includes the following fields:
Name
Email
Employee ID
Joining Date
Each field has validation rules, and ...
Advice
0
votes
3
replies
78
views
How to improve initial load performance in React for content-heavy website?
I’m building a learning platform using React and facing slow initial load times due to large content and components.
What are the best ways to optimize performance (lazy loading, code splitting, etc.)?...
-1
votes
1
answer
89
views
Canva Button SDK returns 403 Forbidden on embed?action=createDesign in Vite + React app — why?
I'm integrating the Canva Button into a Vite + React app. The SDK loads and my React button calls createDesign, but the SDK's embed request returns HTTP 403 and the Canva editor shows a "...
-2
votes
0
answers
59
views
How to store streaming AI responses per message in React without them merging together?
I'm currently trying to write a my first React project using AI API and it's okay for now, except for one thing: every time I send a message, I use use state to display it, but by doing that, if I ...
-6
votes
2
answers
123
views
React App isn't showing components in localhost browser when I run 'Npm run dev'
I am following a tutorial from Youtube by building a React portfolio site. I set up using Vite. I have followed the steps exactly and checked the code. But when running npm run dev localhost my ...
-1
votes
0
answers
51
views
carousel to show text pages using css and Intersection Observer to lazy load pages on demand in react js
I made a carousel to show text pages using css and Intersection Observer to lazy load pages on demand in react js.
I initialized the state with the first 3 pages.
My Goal:
when i scroll right next ...
Tooling
0
votes
2
replies
92
views
How to implement an interactive alumni map with clustering and sidebar in React (Leaflet or Mapbox)?
I am building an alumni networking web application where I want to display alumni locations on a global map along with a sidebar list.
I want to implement the following features:
A world map with ...
Best practices
4
votes
8
replies
356
views
Do I learn React before JavaScript? I'm confused
How do I learn JavaScript as a beginner frontend developer? What resources do I need (video links and written materials)? Also, would you advise diving right into React from CSS? React seems to be so ...
Advice
0
votes
2
replies
72
views
Does a React Activity component in mode visible set by default improve performance?
I often come to this case were I render both ExtendedView and CompactView for a component. Those have a display: none css rule based on a container query. I know that the ExtendedView is more likely ...
Advice
0
votes
2
replies
92
views
How to pause and play video using JavaScript in React web project?
How can I pause and play a video using JavaScript in my React web project? I'm developing it in VS Code.
-3
votes
0
answers
101
views
Immersive cards effect
I'm using assets from https://quaternius.itch.io/3d-card-kit-fantasy in a react project, with r3f.
Assets pack is composed of different elements, shown in the image left to right:
container (with ...
Advice
1
vote
4
replies
235
views
How relevant is Angular in 2026 compared to React, and does learning both help my resume?
My instructor recently asked me to learn Angular, but my last project was built with React. I’m a junior web developer and I’m trying to understand how relevant Angular is in today’s frontend job ...
Best practices
2
votes
11
replies
233
views
Code Review on using two useEffects in a single component
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 ...
Advice
1
vote
2
replies
75
views
Can you access a React component's children of children (nested children)?
In the react reference documentation for the Children API(#transforming-children Scroll down to "Pitfall") it says:
There is no way to get the rendered output of an inner component like &...
Advice
0
votes
0
replies
45
views
React compiler and Jest tests
I added the React Compiler to my project (basic setup from docs), and my all Jest tests failed. Would it be better to disable the React Compiler for tests, or is there a way to fix this? How to do it? ...
Advice
0
votes
8
replies
183
views
"hello chat" Door
I'm working on some projects in Python and JS.
Lately, I decided to speed up the creation process, only stopping to fix bugs.
I found an image in the root of my backend saying "hello chat" ...
0
votes
1
answer
131
views
I want to make a conditional component in React but didnt work, What am I doing wrong?
I have code like this, and it works:
{(users.length === 0) ? (<></>) : (
<Pagination
sx={{ mt: '1rem' }}
page={page}
count={pagination.last_page}
...
-1
votes
1
answer
46
views
MSAL React useMsalAuthentication causes infinite loop on Safari — stale interaction_in_progress
Problem
I'm using @azure/msal-react with @azure/msal-browser v4.28.1 in a React + Vite app. Authentication works perfectly on Chrome and Firefox, but Safari falls into blocked state:
errorCode: "...
0
votes
0
answers
92
views
React Hook Form client side validation not rendering
I have a form and in the console the errors object is populated properly but I am trying to prepar for complex forms so this being dynamoc matters
'use client'
import { get, useFieldArray, ...
Best practices
0
votes
0
replies
43
views
Best approach to output the result of Rich Text Editing in React (NextJS)
I stuck with the Idea about the Rich Text Editors could generate HTML that can be stored in DB and output it on render via Template Files.
This is not the case while building RTE with React (NextJS). ...
2
votes
2
answers
107
views
setInterval() method and useEffect hook not working as intended when trying to update 'timer' state variable
I am working on this lab on freeCodeCamp. I am having issues with the setInterval() method as well as the useEffect hook. Once I click on the button, with every passing second, the timer state ...
Advice
0
votes
4
replies
44
views
Radix UI, Slottable only works when it is a direct child of the Slot component
Like i have a button which contains left icon, right icon and badge in it.
import { Slot, Slottable } from "@radix-ui/react-slot";
const Button = ({
asChild,
children,
leftIcon,
...
Tooling
0
votes
0
replies
72
views
i wana integrate wordpress api in my react native app
I have a mobile application built using React Native (Expo), and the app is already fully functional. I am currently using Firebase for authentication, cart management, and real-time features like ...
Best practices
0
votes
1
replies
67
views
Containers written as HOCs? (in the Container/Presentational pattern)
I keep seeing the Container/Presentational pattern when looking for ways to structure react components. I love the idea of separation of concerns and separating out the data from the view, but then ...
Advice
2
votes
5
replies
131
views
When to Use useState vs Redux for State Management in React
I’m currently working on a React project and I’m trying to determine when to use useState (i.e., local state) versus introducing Redux for managing state. While I understand that Redux can be powerful ...
0
votes
1
answer
149
views
How do I import a different implementation of an interface on client vs server in React Router?
I am replacing the logging system in a large React Router application and the challenge I have is that I want to use a different logger depending on whether the code is running on the server or the ...
0
votes
0
answers
71
views
How to correctly reset form state and handle server errors using React 19 useActionState and useOptimistic
With the release of React 19, the traditional way of handling forms (using useState for isLoading, isError, and data) is being replaced by actions and the useActionState hook.
However, I'm struggling ...
Best practices
0
votes
1
replies
64
views
Data Fetching in React
Noob to React.js/Next.js and web dev in general.
I have a Next.js client parent/container component that is getting too long, even the data fetching functions take about 300-400 LOC. Is it considered ...
-1
votes
1
answer
92
views
Tailwind CSS v4 arbitrary value classes (brackets []) not rendering in Next.js 16 with Turbopack
I am using the latest Next.js 16.1.6 with Tailwind CSS v4.2.1 and React 19. When running the development server with Turbopack (next dev --turbo), arbitrary value classes like aspect-[12/5], z-[100], ...
-2
votes
1
answer
51
views
Vite build error: "useState is not exported by react/index.js" but works in dev mode [closed]
My project works fine in dev mode (`npm run dev`) but fails when I run `npm run build`.
I am using Vite + React + react-router-dom.
During build I get errors like:
node_modules/react-router-dom/dist/...
Advice
0
votes
4
replies
173
views
teach me how to build an leetcode clone
From zero to full-stack — my journey and what I'm building next
help me choose Techstack for my project
before that about myself:
A few months ago I had never heard of TypeScript, APIs, Git, or ...
Advice
0
votes
2
replies
67
views
I have to implement an test scenario for payment can anyone recommend the free tool or module
I'm developing an order delivery app and need some guidance on creating test scenarios for payment implementation using React and Node.js. I'm looking for ideas on how to approach this, as I'm unsure ...
-2
votes
1
answer
100
views
Getting Floating UI to pin a popup on demand
I can't get Floating UI with React to work the way I want it to. I've created a popup component that follows the mouse on mouse move. I can set the pinnedAt prop to cause the popup to pin in place ...
-3
votes
0
answers
121
views
How do I focus a single input on Tab in OpenTUI (@opentui/react)?
I’m using OpenTUI (@opentui/react) and I have only one input field.
I want the input under “Username” to become focused and be able to type the input when I press the Tab key.
import { TextAttributes }...
0
votes
0
answers
70
views
Home.tsx:510 THREE.WebGLRenderer: A WebGL context could not be created
I was using a free Spline animation with .splicecode file .. the page is currently in development phase , running it locally . Only using that one animation also in top of Home Page .
Sometimes it ...
Best practices
2
votes
6
replies
151
views
How can I track impressions on a post?
I am developing a social media platform on which we need to track impressions of posts. Currently, we are tracking an impression when a post fetched from the backend, but the client requirement is to ...
1
vote
1
answer
110
views
SVG Divider flex container not matching height of input in React
I am building a Hero Section in React app and creating a search bar with a dropdown, input field and a vertical divider between them.
The search box is a flex container. I want the vertical divider(...
Best practices
0
votes
4
replies
79
views
In React, s it really bad to call a potentially asynchronous function directly in render code?
I have a question regarding best practices in React.js.
Recently, I came across a blogpost that claimed you shouldn't directly invoke a callback in React render code. And while intuitively I would ...
Advice
0
votes
1
replies
53
views
Handling multiple mentor responses in a React chat application and determining the best answer
I am building a React-based chat application where users can ask questions and multiple mentors can respond to them. In many cases, different mentors provide different answers to the same question.
I ...
1
vote
2
answers
153
views
Cannot deploy Tanstack Start React app to Cloudflare using GitHub Actions
I have developed a React application with Tanstack Start framework. I have also successfully deployed the page to Cloudflare, using CLI commands:
npm run build
npx wrangler deploy
In order to ...
Best practices
0
votes
0
replies
62
views
How to add built-in "Add Task" button in custom React Gantt library without forcing programmers to write manual state update logic every time?
I'm a very new programmer so please excuse how I am asking the question as I am not very well versed in React terminology.
I'm currently trying to implement a feature in the React Modern Gantt library....
1
vote
1
answer
104
views
React Native-cli DateTimePicker spinner not showing light theme on Android
I am using @react-native-community/datetimepicker in a React Native application. I want to use the spinner style time picker with a light theme.
My goal is to keep the UI clean, minimal, and ...
3
votes
1
answer
129
views
placeholder disappears immediately when dropping item instead of waiting for overlay transition
I'm using dnd-kit in a Next.js project to reorder items in a sidebar. Dragging works correctly, but there is a visual issue when the item is dropped.
During dragging, I render a placeholder element (...
Advice
0
votes
3
replies
174
views
Android apps as a React Dev?
What is the best way as a Full Stack React Developer, to create Android mobile apps?