475,825 questions
Advice
0
votes
3
replies
36
views
How do I deal with a bookinglist in a vehicle management system
How do I write a code in reactjs for a booking list to enable an admin be able to get all bookings made by customers and be able to accept and reject the bookings while the customer on the other hand ...
Advice
1
vote
1
replies
43
views
How to dynamically update SEO meta tags in React using native DOM API without third-party libraries?
Problem
I'm building a React app with Vite (not Next.js) and I need to manage SEO meta tags properly across all pages. I need:
A site-wide title template like %s | My Site applied automatically on ...
-2
votes
0
answers
23
views
Tailwind install error “could not determine executable to run” in Vite + React + TypeScript [duplicate]
I’m setting up a new frontend project using Vite with React and TypeScript. When I tried to install Tailwind CSS using the standard steps:
npm install -D tailwindcss postcss autoprefixer
npx ...
0
votes
1
answer
88
views
How do I pass props to a function component in TypeScript? I am receiving an error that it's type is not a valid JSX element type [closed]
Error:
Type '{ activeHeader: boolean; activeMenu: boolean; }' is not assignable to type 'IntrinsicAttributes & boolean'.
'MobileHeader' cannot be used as a JSX component.
Its type '(activeHeader:...
-1
votes
1
answer
37
views
Is there a supported way in Next.js App Router to fetch user data on the server, pass it into global UserProvider, and still keep static pages static?
My app structure is:
A root layout (app/layout.tsx)
A shared Header component, rendered on all pages (including static pages like home/about)
Inside the header, an AuthButtons component that should ...
Best practices
1
vote
3
replies
56
views
Should I migrate from a React SPA (using React Helmet for SEO) to Next.js and split the project into a marketing site (SEO) and an authenticated app?
I have a React application built as a client-side SPA.
For SEO, I am using react-helmet to set page titles, meta descriptions, and Open Graph tags per route.
The problem is that organic traffic from ...
Best practices
0
votes
8
replies
106
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
66
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
79
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
1
answer
52
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 ...
-2
votes
1
answer
182
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 ...
-2
votes
0
answers
65
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
4
replies
102
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
92
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
62
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 ...