New answers tagged reactjs
Advice
0
votes
0
replies
0
views
What is best, React or Flutter?
Both are bad, because no cross-platform framework can deliver a best-in-class user-experience on every device; and they're both even worse in their own way:
Using React means you're using HTML+CSS+JS, ...
Advice
0
votes
0
replies
0
views
What is best, React or Flutter?
Agreed with the above. Every framework has its advantages and disadvantages. I've hopped from language to language and framework to framework over the years. Even if you start out working with Flutter,...
Advice
2
votes
0
replies
0
views
What is best, React or Flutter?
tldr: what brings food on your table.
If you good at both then you know it; Best requires the full context, which can be long discussion....
Advice
0
votes
0
replies
0
views
What is best, React or Flutter?
If you are good at both, then do research about which tech stack has more job opportunities in your country, then go with that.
0
votes
Why does my custom hook cause an infinite re-render in React even though dependencies seem correct?
Inside useEffect, fetchData() is called, which sets the state using setData. When state updates, the component rerenders.
On the next render, a new fetchData function is created again. Since fetchData ...
-1
votes
Why does my custom hook cause an infinite re-render in React even though dependencies seem correct?
Because fetch data is a new function on every render and when the effect run it sets state and make effect run again because of fetch data ref changes that make React think dependency is change, Hence ...
-3
votes
How to set up an endpoint for Health check on Next.js?
For Next.js 13+ (App Router), the modern shape of a health endpoint is a Route Handler. But the more important point is buried in the existing answers: a health check that just returns 200 is almost ...
Advice
0
votes
0
replies
0
views
How to make a dialog close when pressing Esc key?
If you have an actual technical issue or question about a specific problem then my advice to you is to:
Delete this question
Create a new post via https://stackoverflow.com/questions/ask
Take care ...
Advice
0
votes
0
replies
0
views
How to dynamically update SEO meta tags in React using native DOM API without third-party libraries?
Mojtaba’s pattern works if you can pull in a library, but the OP explicitly said no third party dependencies, and react helmet async is one. That constraint is actually fine here. The whole thing is ...
Advice
0
votes
0
replies
0
views
How to structure a React project for stock management?
A good rule of thumb: if your structure already feels confusing, it’s probably too generic and not domain-driven enough.
For a stock management system like yours, I’d strongly recommend organizing ...
1
vote
React Three Fiber SkinnedMesh (6.4MB) fails to render on mobile browsers but works perfectly on desktop
Root Cause: EXT_texture_webp extension
The model failed to load because the GLB file used the EXT_texture_webp extension (textures stored as WebP for compression). xr-frame does not support WebP ...
Advice
0
votes
0
replies
0
views
How to structure a React project for stock management?
I have seen suggestions that code should be split by feature, from top to bottom (vertical slices) - so all hooks, components and other implementations regarding one feature comes to that feature's ...
0
votes
how to use .env file in a react js with typescript project?
I saw some answers here and they suggest to add types to the variable, but that didn't work for me. Here's what I did and it worked like charm!
Install npm i --save-dev @types/node. (Ignore if ...
0
votes
How can I make the .git folder not disappear in the build folder after npm run build?
This is what works for me. The trick was to just use BASH instead by adding a .npmrc file with the contents
script-shell=C:\\Program Files\\Git\\bin\\bash.exe
and then use this for your prebuild and ...
Advice
4
votes
0
replies
0
views
How to structure a React project for stock management?
Sorting React components into "components" and "pages is pretty typical.
Instead of "redux" one might call this directory "state"
A "services", or ...
Advice
1
vote
0
replies
0
views
Need Suggestion for best MERN stack online course?
I changed the the gigantic title to a regular sentence in the first paragraph. You already have a question title. No need to have two titles, please.
Advice
0
votes
0
replies
0
views
Need Suggestion for best MERN stack online course?
No problem - although I'd point out that basic grammar applies everywhere, not just on Stackoverflow, so it being your first day here needn't affect that :-)
Advice
2
votes
0
replies
0
views
Need Suggestion for best MERN stack online course?
If it's your first post, take the tour, check the Help Center, read What topics can I ask about here? and How do I ask a good question?.
Advice
1
vote
0
replies
0
views
Need Suggestion for best MERN stack online course?
"Can you" no. Just as we can't suggest a best car, best pizza or best coffee without knowing what your actual requirements are, what you already know and what you want to do. Actually learn? ...
Advice
0
votes
0
replies
0
views
Need Suggestion for best MERN stack online course?
Thanks, for the feedback.
I will improve on that.
By the way, it's my first day here.
Advice
2
votes
0
replies
0
views
Need Suggestion for best MERN stack online course?
What research have you already done online? Are there any courses we might recommend that you are already ruling out for any reason? It's fine to ask for opinions but the way this is written currently ...
Advice
1
vote
0
replies
0
views
Need Suggestion for best MERN stack online course?
Questions don't end with !, they end with ?. Likewise, statements (like the one in the title) don't end with ?. Check your grammar and have another go. :-)
Advice
0
votes
0
replies
0
views
Need Suggestion for best MERN stack online course?
Sorry my bad, I will edit the question!!
0
votes
React: How to have VSCode auto-complete with single-quotes in most places, but double-quotes in JSX tags?
Seems like this settings make autocomplete to work:
{
"[javascriptreact]": {
"js/ts.preferences.quoteStyle": "double"
},
"[typescriptreact]": {
&...
-3
votes
React: useState or useRef?
import { useState, useRef } from 'react';
export default function Stopwatch() {
const [startTime, setStartTime] = useState(null);
const [now, setNow] = useState(null);
const intervalRef = ...
0
votes
How to prevent useSWR trigger re-renders when state change in React?
Your console log of data is printed every time open changes because open is a state value so when it changes the entire component tree has to be re-rendered and your console log is run again.
Data ...
Advice
0
votes
0
replies
0
views
How should I structure a 50-day learning plan for React and Node.js as a beginner with JavaScript basics?
Build them up simultaneously, otherwise one side or both will get away from you.
Advice
1
vote
0
replies
0
views
How should I structure a 50-day learning plan for React and Node.js as a beginner with JavaScript basics?
It all depends on your basic JS knowledge. If you are confortable writing functions to a spec like:
write a function that takes an array of users objects shaped like:
{ id: 1, name: 'Maria', age: 35 }...
0
votes
Why is useEffect not running on route change when navigating between dynamic segments in my Next.js app router?
I recommend you should use usePathname().
In the App Router, navigating between dynamic routes does not unmount the page component by default. In this case, useParam() doesn't update but usePathname()...
-1
votes
React with Cypress problem when using jQuery
You might need to add a tymeout cy.get('.myClass', { timeout: 5000 }) if that does not help your Button most likely doesn't render correctly in the first place.
Check your developer tools and see if ...
Advice
1
vote
0
replies
0
views
React useState not updating inside setInterval even with functional update
In your current code the setSeconds(prev => prev + 1) should work just fine. Your issue lies somewhere else.
Example with your exact code using that approach
function Timer() {
const [seconds, ...
Advice
0
votes
0
replies
0
views
How should I structure a 50-day learning plan for React and Node.js as a beginner with JavaScript basics?
most resources provide long-term roadmaps (3–6 months), which does not fit my timeline.
You could always compress it and take more of the courses in a single day or whatever. These programs may not ...
Advice
1
vote
0
replies
0
views
How should I structure a 50-day learning plan for React and Node.js as a beginner with JavaScript basics?
You can use ChatGPT to help break down your tasks and plans into structured daily to-dos. This approach makes your learning process more systematic and aligned with real-world development practices. ...
Advice
0
votes
0
replies
0
views
React useState not updating inside setInterval even with functional update
Self-answers are welcome, but this is the exact dupe of this question and few others. Please, avoid posting the questions as open-ended for specific debugging problems, which are classic SO questions.
...
Advice
1
vote
0
replies
0
views
React useState not updating inside setInterval even with functional update
You need a way to always read the current state inside the interval. Combine useRef to hold the latest value without causing re‑runs:
javascript
function Timer() {
const [seconds, setSeconds] = ...
0
votes
Can't use Shadcn components
For anyone still experiencing this issue, go into the components.json file and update the aliases object by adding "src/" before the @. Like so:
"aliases": {
"components&...
0
votes
How to exclude specific routes from parent layout component in TanStack Router?
You can use _ as a file name sufft to opt out of layout if layout you don't want, please see official Tanstack router doc at https://tanstack.com/router/latest/docs/routing/routing-concepts#non-nested-...
Advice
0
votes
0
replies
0
views
What are good ways to improve a simple React user administration app?
I looked through your code it it seems AI written. This is a new code with type script :
User.tsx:
import { useNavigate } from "react-router-dom"
export const UserComponent = ({ user, ...
Advice
0
votes
0
replies
0
views
What are good ways to improve a simple React user administration app?
There are a few issues with the imports, i would recommend using these imports:
Users.tsx
import { type User as UserType } from "../services/user.service";
import { User } from "./User&...
Advice
0
votes
0
replies
0
views
What are good ways to improve a simple React user administration app?
I looked at your code and rewrote it with a few improvements. The main additions are React Router (Routes, Route, useNavigate, useParams) so the list, create form and edit form each get their own URL —...
Advice
0
votes
0
replies
0
views
What are good ways to improve a simple React user administration app?
I would recommend writing this component in TSX instead of JSX, as it provides better type safety and can help catch potential issues earlier. To make things easier, I’ve gone ahead and translated ...
0
votes
Why is useEffect not running on route change when navigating between dynamic segments in my Next.js app router?
The problem is that ProductPage is a Client Component, so you only receive data from useParams from the initial page load and when you change Product "pages" you're changing the route but ...
Advice
0
votes
0
replies
0
views
What are good ways to improve a simple React user administration app?
This is a great project to learn and expand on your React knowledge and you've got a lot of the basics down but understanding the principles of modern React and learning best practices will help you ...
Advice
0
votes
0
replies
0
views
What are good ways to improve a simple React user administration app?
One of the main points of frontend apps is to interact with a backend of some kind.
Write the backend yourself, or mock it via json-server. You can interact with it via the fetch API.
After you have ...
Advice
1
vote
0
replies
0
views
What are good ways to improve a simple React user administration app?
What exactly is the concern here? What are you looking to "improve"? Are you more looking for a general Code Review?
but I feel like there's a lot of room for improvement and I'm not sure ...
0
votes
How do I stop my three async API function calls from running out of order since they are dependent on each other?
This is a straightforward async sequencing problem. You need to chain your calls so each one waits for the previous one to complete before running.
The cleanest solution is to use async/await in a ...
Advice
0
votes
0
replies
0
views
How to dynamically update SEO meta tags in React using native DOM API without third-party libraries?
You’re on the right track identifying the problem — the issue isn’t React, it’s lack of a centralized SEO layer.
In a Vite + React setup, the typical solution is to wrap something like react-helmet-...
1
vote
Accepted
How to redirect user to home if they're already logged in and is trying to access the login page?
Issue
This is one of the classic issues with React and React-Router where the enqueued state updates are processed asynchronously (i.e. updating the authentication state) while navigation actions are ...
0
votes
React Native Error - yarn' is not recognized as an internal or external command
For me, Yarn was installed but was missing from my PATH. Assuming the PC runs Windows:
Open folder %AppData%/npm and ensure yarn.ps1 is present.
In the start menu, search "Edit environment"
...
3
votes
Why is useEffect not running on route change when navigating between dynamic segments in my Next.js app router?
The correct pattern in Next.js 14 is to move data fetching to a Server Component. This eliminates the need for useEffect entirely for the initial data load
export default async function ProductPage({ ...
Top 50 recent answers are included
Related Tags
reactjs × 478471javascript × 206181
react-native × 40048
react-hooks × 36215
typescript × 33494
redux × 27792
node.js × 27037
css × 24877
next.js × 21614
material-ui × 19416
react-router × 19274
react-redux × 19023
html × 18491
webpack × 11181
axios × 10771
jestjs × 9149
firebase × 9048
arrays × 8721
express × 8459
jsx × 7972
react-router-dom × 7483
ecmascript-6 × 6771
npm × 6768
json × 5769
state × 4652