All Questions
475,987 questions
1 vote
0 answers
9 views
How to make an image upload similar to linkdn using react [closed]
I want to make one feature that is similar to linkdn profile upload feature.
1 vote
2 answers
50 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 ...
1 vote
1 answer
63 views
Production build crashes with "Cannot access 'lt' before initialization"; how to trace minified variable back to source
I have a React 19 + Vite 7 + TypeScript app that works perfectly in development but crashes immediately when I build for production and serve it. After a successful build I preview the output using ...
Advice
0 votes
3 replies
21 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
37 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 ...
0 votes
1 answer
96 views
Unexpected re-render despite no parent rerender and no change in props or state [duplicate]
I have been trying to optimize one of my team's component and despite successfully reducing the number of re-renders I have noticed one unexpected re-render that I just can't wrap my head around. The ...
-3 votes
0 answers
32 views
Testing submitting a form object in a React Jest unit test [closed]
I'm writing unit tests in React and we're using Jest. I have a component that takes in some basic information on a user profile, first name, last name, address, city, state, zip. The form is in a ...
0 votes
0 answers
13 views
HMR Module replacement is disabled [duplicate]
Uncaught runtime errors: × ERROR [HMR] Hot Module Replacement is disabled. at ./node_modules/webpack/hot/dev-server.js (http://localhost:3000/static/js/bundle.js:5819:9) at options.factory (http://...
-2 votes
1 answer
61 views
Next.js server-side rendering [closed]
I am trying to adjust my sidebar in a dashboard and I load the value from localstorage and I get this issue from Next.js A tree hydrated but some attributes of the server rendered HTML didn't match ...
0 votes
1 answer
71 views
How to isolate isPending state from useActionState to prevent full form re-renders in React 19? [closed]
I am experiencing performance bottlenecks in a large form (100+ uncontrolled inputs) after migrating to React 19's useActionState. The Setup: I use uncontrolled components with defaultValue to keep ...
-3 votes
1 answer
56 views
React localhost:3000 refused to connect despite "Compiled successfully" on Windows 11 [closed]
I am running a React project on Windows 11 using VS Code. My terminal shows 'Compiled successfully' on port 3000 (and I've tried 4000 too), but the browser (Chrome/Firefox/Edge) always shows '...
Best practices
0 votes
1 replies
52 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
1 vote
5 replies
92 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 ...
1 vote
0 answers
101 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
1 answer
51 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 ...