476,972 questions
-3
votes
0
answers
27
views
_emotion_styled__rspack_import_0 is not a function
When using rspack with typescript and Material UI (MUI) with React to run in development mode, the following error is thrown:
_emotion_styled__rspack_import_0 is not a function TypeError: ...
Advice
0
votes
1
replies
23
views
Should I use transformer functions for the data I get from API?
I have a project in Next JS and I am fetching data from API using TanStack Query. I am also using openapi-typescript package for generating API response types automatically from the openapi.json file. ...
-1
votes
0
answers
26
views
Error in moving tasks from scheduled to mytodo
I'm currectly working on a todoapp using reactjs. I have a mytodo, scheduled tasks and completed tasks section. now when I create a new scheduled task, I have the option of moving it from the ...
-1
votes
0
answers
31
views
Component shows as memoized in DevTools but still re-renders
I'm facing an issue with the React Compiler auto-memo.
React DevTools shows that Test2 is memoized (sparkle icon), but console.log still runs on every render.
import { useState } from "react"...
1
vote
2
answers
74
views
How to prevent rerender of identical component in child?
I'm trying to make a progress bar that has a transition animation. Think: a multi-page wizard, and when you advance to the next page the progress bar animates to the next step.
When the progress bar ...
-3
votes
0
answers
28
views
Mantine Slider Thumb Stuck and Not Updating [closed]
I'm new to React and I'm having a problem with Mantine.
My Slider is visible and the value updates, but the thumb stays stuck on the left and doesn't move at all.
Here is my code:
<Box
ref={ref}
...
-1
votes
0
answers
38
views
When client opens it from browser history it opens JSON return not a component [closed]
I have problem with all Inertia projects. When the user opens the page from their browser history it opens a JSON not a React page.
How can I prevent this? I have:
"dependencies": {
&...
Best practices
1
vote
5
replies
86
views
Where to manage the state of individual items in a list
So, being used other reactive frameworks I'm now starting to learn and work with React. I'm building a simple exercise and I'm struggling with the way State is managed in React, I'll already have ...
-3
votes
0
answers
35
views
Chrome throws “Failed to connect to MetaMask” even though my React project does NOT use crypto/web3 (Opera works fine) [closed]
enter image description here
I’m building a normal React project (not related to blockchain, crypto, or MetaMask).
However, Chrome gives this uncaught error in the console:
Failed to connect to ...
0
votes
0
answers
46
views
For a large-scale React/Next.js application, when does Redux Toolkit become an anti-pattern compared to using React Query/SWR and useReducer/Context [closed]
With the maturity of server-state libraries like TanStack Query (React Query) and the improvements in React's native state management, I'm re-evaluating the necessity of Redux Toolkit for global ...
-1
votes
1
answer
44
views
TypeError: Cannot read properties of null (reading 'getConfig') [closed]
how can i resolve this problem and this my jest.config.js
module.exports = {
preset: 'react-native',
"setupFilesAfterEnv": [
"@testing-library/jest-native/extend-expect"
]...
-1
votes
0
answers
24
views
Applying the onRowSelectionModelChange for React Material UI DataGrid [closed]
I'm trying to apply the row selection model in React Material UI.
Intension here is to show the rowId when a row is selected so that I can show the row action buttons as DELETE/EDIT.
I'm using the &...
-1
votes
0
answers
28
views
MUI X-date-pickers output and none visible redundant characters
I'm using "@mui/x-date-pickers": "^8.19.0" and @mui/material": "^7.3.4" in a "next": "15.5.6" application with "react-dom": "19.2....
-4
votes
0
answers
66
views
Catch error thrown from child route in tanstack
I want to control conditions related to that route in each route instead of building central navigation system in the root route that checks from and to of the navigation event.
To that, my idea was ...
-4
votes
0
answers
21
views
Expo LocalAuthentication works on iPhone(IOS 26) but not on iPad mini(iPadOS 26) [closed]
A bit lost here, I have the following code running trought expo go and it does nothing on my iPad but it works fine on my phone:
import * as LocalAuthentication from 'expo-local-authentication';
...
Best practices
0
votes
1
replies
49
views
What’s the best architecture for mixing local AI + cloud AI inside a React/JS app without turning the codebase into spaghetti?
I’m trying to design a “future-proof” React/JS setup where the app can switch between different AI backends (local models like WebGPU/WebLLM, API models like OpenAI/Gemini, and maybe even custom ...
-1
votes
0
answers
54
views
Getting spacing and alignment in JSON Forms correctly
I'm trying to use JSON Forms to create different forms for my website, and I'm using custom buttons and input fields (using custom renderers) to render the form. I'm interested in making the UI right, ...
0
votes
0
answers
26
views
How can I create an in-curved notch/cutout in a div border where another div overlaps it? [closed]
I'm trying to recreate an overlapping box layout where one box appears to "intrude" into another box's border with a smooth, curved notch effect (not just a straight cutout).
Here is the ...
-3
votes
1
answer
60
views
The proper way to assign a default value to a React component prop
I'm looking for a working & elegant solution to assign a default prop value to a React Native core component such as Text.
In the past, we'd do something like this and override it at the index.js ...
0
votes
2
answers
52
views
How to display <NavLink> components outside MemoryRouter in React Router? [duplicate]
How to display <NavLink> components inside the Footer? I cannot place the Footer inside RouterProvider. The Footer component should be displayed on every page.
function App() {
const router = ...
2
votes
1
answer
71
views
React 18 streaming chat messages updating with stale state
i’m building a small AI chat ui in react (next.js app router, react 18) that streams tokens from my backend (openai style stream). basic flow:
user types a prompt
i push the user message into ...
0
votes
0
answers
51
views
React SSR (being used as binding in cloudflare) HMR required in cloudflare worker
I'm working on a project, which uses a react SSR module (using Vite). Then I'm using a seperate worker which loads my site and there's link /load-ssr which loads the SSR module as a "binding"...
-2
votes
0
answers
38
views
Supabase realtime postgres changes with RLS policy [closed]
Im having an issue with supabase postgres changes. I have a subscription on frontend to watch for changes on a table using RLS policy to only see the changes of the current user.
The problem that im ...
Best practices
1
vote
4
replies
126
views
What do you think is the best practices when working with React projects?
I want to hear your personal opinion. And I would like to hear what way y'all prefer when working with React projects.
I'm currently working with a full-fledged ecommerce website. I would love to hear ...
0
votes
0
answers
33
views
Unexpected stale state in React when setState runs inside a loop [duplicate]
Why does updating state in React inside a loop cause stale values even when using functional updates?
0
votes
1
answer
53
views
How to remove the iOS accessory bar on mobile? [closed]
On a React App, I'd like to remove the accessory bar that appears above the iOS keyboard when we are focusing on a textarea. Is it possible ? I tried a few things saw on the internet but nothing works ...
0
votes
0
answers
74
views
Vercel build error: “Cannot find module '../lightningcss.linux-x64-gnu.node'” when building (Vite + Tailwind + React) project [closed]
I’m trying to deploy my personal website to Vercel using Vite + React + Tailwind CSS. The project builds and runs fine locally (npm run build works without errors), but the Vercel build fails with the ...
Best practices
0
votes
3
replies
74
views
Using setTimeout within useEffect() to debounce searching in react native pagination
I am planning to implement pagination into my project for my data from Supabase, I had the idea that since there are different parameters (such as search text, page number, filter) that I should use ...
Advice
1
vote
2
replies
71
views
React Router v7 SPA mode: How to use strict CSP?
I'm migrating an app from React Router v6 + Webpack to React Router v7 (SPA mode) + Vite and I'm having issues with setting a strict Content Security Policy.
In RR6 I had a normal index.html and ...
0
votes
1
answer
98
views
How to skip debounce on the first keystroke only?
I have a simple debounce implementation using `useEffect` and `setTimeout` that delays updating a `value` state by 1 seconds after the user stops typing in an input:
import { useEffect, useState } ...
0
votes
1
answer
56
views
App Freezing when I submit a form using Actions in Next app?
I'm currently working on my first NextJS app after a long hiatus. The first thing I'm working on is a small app that's powered by Firebase.
After reading some documentation on Context and then ...
Best practices
0
votes
2
replies
93
views
Best way to initialize data in next js app router with zustand
I’m building an e-commerce type website in Next.js where there are multiple sections of stores. Each store card has a heart icon to mark it as a favourite.
The same store can appear in:
multiple ...
Advice
1
vote
1
replies
46
views
I would like to know why the ref in my onMessage handler requires spreading before flushing
Here is my on message handler:
const onMessage = (event: MessageEvent) => {
try {
const message = JSON.parse(event.data);
const normalizedMsg = Array.isArray(message) ? message : [...
2
votes
0
answers
58
views
Module Federation with React Vite: React-Three-Fiber Canvas Not Loading, "Cannot read properties of undefined (reading 'current')" [closed]
I'm building a React Vite application for 3D modeling using react-three-fiber. I recently integrated a microfrontend (MFE) using the module federation plugin and shared React and other core packages ...
-1
votes
0
answers
77
views
Can a React (Vite) SPA prevent a component from being included in the client bundle until after backend authentication? [closed]
I have a React (Vite) frontend and a FastAPI backend.
I want to protect /dashboard so that the Dashboard.jsx component is not downloaded by the browser unless the user is authenticated.
In a normal ...
1
vote
0
answers
55
views
How to make custom Web Components with Tailwind CSS react to container width instead of window.innerWidth? [closed]
I'm building an embedded widget as a Web Component using Vite + Tailwind CSS.
When the app runs standalone, Tailwind responsive breakpoints (sm, md, lg, xl) work correctly, because they react to ...
-1
votes
0
answers
25
views
How to debug on stage environment on AEM Cloud for custom service Interface and implementation class [closed]
We have a popup functionality that works fine on AEM as a Cloud in Dev and Local environments, but it’s not working in Stage and Prod.
Here’s the setup:
We are using Sling Model Exporter and an AEM ...
-1
votes
1
answer
94
views
tailwind classes are loaded but coloring css variables no applied
I am using TailwindCSS in my React + Vite project, and the classes are loaded correctly. The UI looks complete.
The problem is that colors from variables defined in tailwind.config.js are not applied.
...
0
votes
1
answer
28
views
multi-select jumps to old selection if clicked and updates properly later
In my react application I have a simple html select that has the multiple attribute set.
When the selection changes a server request is issued and afterwards the component is re-rendered.
The problem ...
Best practices
0
votes
2
replies
52
views
React RTK Typescript: Using `ReturnType<AppStore['getState']>` vs `ReturnType<typeof store.getState>` when inferring RootState type
I've been reading up on React/Redux documentation, specifically on setting up types for the main redux application store, and was wondering if there are any significant differences when it comes to ...
Tooling
0
votes
1
replies
50
views
Azure App Service: Extracting a 60MB node_modules ZIP takes longer than running npm install — how to speed this up?
I have an automated deployment tool that generates a React or Angular project, uploads it to Azure App Service, and then restores node_modules to reduce build time.
To avoid running npm install on ...
-1
votes
0
answers
43
views
Displaying/Rendering multiple TIFF/GeoRaster layers on React-Leaflet Map [closed]
I'm working on a React project where I'm using React-Leaflet and need to display GeoTIFF (.tif) layers on multiple maps within the same page.
Overview: I have several Leaflet maps rendered ...
-1
votes
0
answers
55
views
Is there a way to call the tRPC client with tRPC and @tanstack/react-query setup? [closed]
I have set up my tRPC backend as per the docs which I'll paste in below. My issue is using it with @tanstack/react-query works perfect for 90% of my use cases but I can't physically call my backend ...
1
vote
1
answer
63
views
How to find coordinates of a polygons vertices
I have a React application that uses React leaflet to render a map and I can draw a polygon on the map using a function I've written. I want to submit the polygon that's drawn to an SQL database and I ...
-2
votes
0
answers
41
views
Error entering clerk's email verification code [closed]
I am building a mobile application and the framework I am using is React Native + Expo. When it comes to verifying the clerk's email, there is an error that the verification failed. I received the ...
Best practices
0
votes
2
replies
51
views
Best approach to make a form with multiple models with laravel inertia and react
I'm currently learning inertia with react after using livewire and finding myself quite limited so I'm making a sample project that makes invoices to practice making forms and saving data to a ...
Best practices
0
votes
0
replies
78
views
How handle I correct a SVG icon in React?
I use SVG icons in a typescript / react application. The icons are in a SVG file. Every icon has an ID tag (the common way).
In code I reverence the icon:
<svg className="icon icon-lg" ...
Advice
0
votes
5
replies
73
views
Deploy Laravel version 12 (PHP, Inertia, ReactJS, Tailwind) to cPanel shared with no SSH Access
I have Laravel 12 project (PHP, Inertia, ReactJS and Tailwind) project that I need to deploy to a cPanel shared server. I do not have SSH access to the server, and the service provider does not give ...
-1
votes
0
answers
44
views
How to override Radix theme ::before ::after styles [closed]
I am using Radix theme https://www.radix-ui.com/themes/docs/overview/getting-started and I am specifically using the Table component.
I want to override default styling for just the Table.Header ...
0
votes
1
answer
164
views
Position sticky top animation works only when scrolling down, otherwise there is a jump
I have a sticky bar on the right side of my page and I want to animate its top property (and height) to nicely fit its transition to disappearing announcement bar at the top of the page. Below video ...