476,973 questions
1
vote
1
answer
119
views
Custom text input with an optional icon and styling
I am trying to create my TextInput component that wraps around React Native's TextInput, but applies additional styles and adds more features.
Unfortunately, I am stuck at the very start of my ...
1
vote
1
answer
146
views
Render Error: "Cannot call a class as a function" in react-native / expo
I am pretty new to react. Making an app that uses Nominatim / expo-maps. I did not run into this error until adding the destinationSubmit function and popup stuff in OahuMap.js. From the research I ...
0
votes
1
answer
52
views
Browser text selection highlight disappears when showing custom toolbar on selection
I have a reader page where I show a floating toolbar after the user selects text. When the toolbar appears, the browser's native selection highlight (the blue/OS-specific highlight) disappears, making ...
1
vote
1
answer
85
views
Typing app text breaks mid-word and new lines start with a space
I'm building a typing app in React and Tailwind. I render a sentence by mapping over each character and outputting a <Character /> component (which is a <span>) for each one.
I'm having ...
2
votes
1
answer
130
views
How can I correctly save and restore Excalidraw drawings from localStorage in a component?
I’m working on a React component that uses Excalidraw, and I want to save and load drawings from localStorage so users don’t lose their work after refreshing the page.
import { Excalidraw } from "...
2
votes
1
answer
156
views
keydown event doesn't work properly on React
I'm trying to recreate Wordle as a practice for React, and I'm having problems with the keydown event. The idea is that when I press a letter the program writes that letter into a cell and moves to ...
0
votes
0
answers
118
views
React Three.js: "Error creating WebGL context" even though WebGL works on https://get.webgl.org/
I'm developing a hero section for my React portfolio that includes a 3D model rendered with Three.js via @react-three/fiber.
However, when the component loads, I see this error in the browser console:
...
0
votes
2
answers
101
views
Why does App render 3 times in this example? [duplicate]
function App() {
let [number, setNumber] = useState(0)
function handleClick() {
console.log('click registered')
setNumber(1)
}
console.log('App rendering')
return (
<>
...
1
vote
1
answer
359
views
How do I use the built-in MCP server in Next.js 16 and configure next-devtools-mcp? [closed]
I'm exploring the new MCP (Model Context Protocol) server introduced in Next.js 16, and I’d like to understand how to properly enable and use it in a development environment.
What I’ve done so far:
...
2
votes
2
answers
171
views
new TypeError("Wrong module specifier", "") with react import
I would like to import a simple mui component.
My component:
import Button from "@mui/material/Button";
export default function Bar() {
return <Button variant="contained">...
0
votes
1
answer
161
views
ShadCN Calendar inside Popover not interactive
I am using the Calendar component from ShadCN UI inside a Popover in a React + Vite project. When I click the trigger button, the Popover opens, but the calendar is not interactive - I cannot select ...
0
votes
1
answer
65
views
OpenLayers boundingExtent returns a single point
I'm trying to zoom to a clicked cluster in OpenLayers in order to show polygons in that cluster.
const zoomToCluster = (cluster: Feature) => {
const features = cluster.get('features')
const ...
-3
votes
2
answers
130
views
How to force client reload page when react has updated code in server
I'm facing an issue with my React single-page application (SPA). Every time I build and deploy an update to the website, users need to manually hard-refresh their browsers (using Ctrl+Shift+R or F5) ...
2
votes
1
answer
115
views
Component Inside another state doesn't rerender when state changes
The below block of code works. Component rerenders when state changes from parent (MainBox)
export function MainBox(){
const [valuestate, setvalueState] = useState()
return(
<div&...
0
votes
1
answer
92
views
Motion React cascading animation
I am trying to make a hamburger dropdown with animations on each of the menu options. Unfortunately, I have a problem with the exit animation.
I don't know how should I implement it, but what is ...
0
votes
2
answers
72
views
Offline English-to-Bengali transliteration of dynamic text in React Native
I’m working on a multilingual React Native app and using i18next for static UI strings like “Submit” or “Profile” — that part is solid.
But I also need to display user-facing names (stored in English) ...
3
votes
1
answer
81
views
Function is called every time in useEffect
I have this function which called to an API returns the data and I have this blog component which i'm trying to write. When I run the useEffect the console.log keeps showing the data in the console.
...
0
votes
1
answer
73
views
Element type is invalid on render method of "App" using Jest
I am attempting to run a simple Jest test to render the App element. This is our App.test.tsx:
test('render application', () => {
render(<App />);
}
This is the error that is being ...
0
votes
1
answer
49
views
React Native ScrollView not scrolling on web (works fine on Expo Go)
I don't know why even if I have ScrollView in my index.tsx and added some styles to it like: overflowY: 'scroll'. Everything works correctly on expoGo while on web it doesn't.
Here is simplified Index....
1
vote
0
answers
57
views
Issue where page is splitting unnecessarily when using react-to-print
I have an issue, where the page is splitting unnecessarily.
I have three components a header, a title and a chart using chart js, the issue is the header and title is coming in the first page and ...
3
votes
2
answers
115
views
How to handle multiple submit buttons with Antd Forms?
Consider the following code:
import { Button, Form } from 'antd'
export function App() {
const submitForm = (data: {submit: 'foo' | 'bar'}) => {
console.log(data)
}
return (
<...
0
votes
0
answers
45
views
When calling the same server action on the client side, the second request disappears
I have a request which its get wallet details in server action. First request is working properly. But after user changes, I can see log top of it but its not entering server action. For example:
...
0
votes
0
answers
49
views
MSW intercepts Static assets in Vite
I'm trying to intercept REST API request using MSW, but it keeps hi-jacking static images in public folder
https://mswjs.io/docs/api/is-common-asset-request/
I tried to use isCommonAssetRequest, but ...
3
votes
1
answer
91
views
React useContext + useReducer with Typescript
I am "translating" this react example into typescript: https://react.dev/learn/scaling-up-with-reducer-and-context#step-1-create-the-context
without success so far! The UserUpdateContext &...
3
votes
0
answers
89
views
@tensorflow-models/face-landmarks-detection no longer works with tfjs. 403 error in network request for model
I get an error while trying to run tfjs. It was working last week but it seems that the url for model is no longer available. Any suggestions for working model url/refactor?
import {
createDetector,
...
0
votes
0
answers
19
views
React redirection using auth [duplicate]
I have a app where I am using JWT authentication. When I enter the details and click on the register button, the backend API correctly returns the token but in my console the token stays only for some ...
0
votes
1
answer
107
views
Youtube embed video only loads on a fresh page load in next js
Using the react-youtube package, I'm displaying a series of youtube videos on iframes. It works when the page is navigated from an outside url or on a page refresh. However, the videos don't load when ...
1
vote
1
answer
58
views
Android elevation not respecting borderRadius in React Native
I’m working on a React Native app ( "react": "19.0.0",
"react-native": "0.78.0") for Android.
I want to add a shadow using elevation on a View that has ...
0
votes
0
answers
60
views
Chakra UI modular theme imports break base styles after bundle optimization
I’m trying to optimize bundle size by importing only the Chakra UI components I use (Box, Card, Flex, Icon, Heading, SimpleGrid, GridItem, Stack, VStack, HStack, Text, Button, Link, Container) and ...
0
votes
0
answers
73
views
onBlur firing before onChange when selecting from dropdown - value not saved
I have a React component WidgetInlineEditField that wraps an inline-editable input field. When editing a time value using a TimeInput component with a dropdown, the onBlur event fires before the ...
0
votes
1
answer
113
views
tailwind does not use CSS variables I defined in global.css [duplicate]
I am trying to make an app, using tailwind for styling. The problem emerges when I try to use my variables with tailwind. I made seperate config for tailwind, declared the variables in global.css, but ...
1
vote
1
answer
81
views
Is it possible to set up a gulp-based build to compile css modules for react components
I have an existing Express project where I'd like to add css modules locally scoped to my react components. The project relies on a gulp build script. I have recently added react to the project to ...
0
votes
0
answers
131
views
Next.js + Framer Motion page transition: new page appears at old scroll position before jumping to top
Context / goal:
I’m building a Next.js project with Framer Motion for page transitions. The old page should slide out from its current scroll position, and the new page should slide in starting at ...
2
votes
0
answers
86
views
NextAuth sends two refresh requests simultaneously on page reload (refresh token rotation)
I'm using NextAuth with a custom backend in my Next.js app.
When I refresh the page, two refresh requests are sent almost simultaneously.
The first request correctly calls /auth/refresh and gets a new ...
2
votes
1
answer
84
views
Reuse the same user routes under '/' (UserLayout) and '/admin' (AdminLayout) without duplication
I need to define user pages (Home, Cows, Reports, …) once and make them accessible to AppUser + Admin under "/" with UserLayout, and also accessible to Admin under "/admin/user/*" ...
2
votes
2
answers
110
views
Why isn’t my CSS position: sticky working? [duplicate]
I have sidenavigation, that has container as a wrapper for position: sticky and height of container is equal to next element in it`s parent flex component:
I am using Nextjs and SCSS:
export function ...
0
votes
1
answer
94
views
React React-leaflet and MarkerClusterGroup, can't access property "useState" error
i have more than 13300 points of interests to show on a map.
i have created a app with starter react app, react-leaflet and react-leaflet-markercluster
but i have this error "can't access ...
0
votes
1
answer
82
views
draw mode in react leaflet not working consistently
I'm trying to implement a feature that lets the user draw polygons on a map in a react application that uses react leaflet as the map library. The drawing sort of works, but placing the vertices is ...
0
votes
0
answers
84
views
PDF field misalignment between React-PDF editor and final signed PDF (fields shift down by one field height per placement)
I'm building a custom React-based PDF editor and signer using react-pdf and pdf-lib.
The editor (PdfEditor.tsx) lets users drag-and-drop fields (Signature, Email, Date, etc.) on a PDF canvas.
Later, ...
1
vote
3
answers
103
views
How do I move focus through a list with keyboard navigation using Refs?
I have an unordered list in a React app, and I want to be able to navigate through the list using down/up arrows. The list is rendered conditionally, based on whether a variable is null or not (the ...
-1
votes
1
answer
104
views
Application fast in development mode but extremelly slow in production after `npm build` [closed]
I'm having a strange performance problem in my React + Vite application.
Everything works well and quickly during development mode (npm run dev).
Also, when building the project itself (npm run build) ...
0
votes
0
answers
81
views
Capture System Audio using the Media Stream
I am building an application using the React Vite app for the frontend. In my application, I have a module for voice-to-text using the Azure Speech SDK. I am encountering an issue: when I start ...
0
votes
1
answer
95
views
how can I create custom Gradient colors in chakra ui v3
I am using this approach
<Box bgImage="gradients.gradientBluePurple_toR_600" w="64" h="64" />
Here’s my current theme setup:
// src/theme/foundations/theme.ts
...
0
votes
0
answers
75
views
Facebook Login for Business: “This app is not usable” error when logging in with other accounts (React + react-facebook-login)
I’m integrating Facebook Login for Business into my web app, but I’ve hit a problem that I can’t figure out.
I created a Facebook App in Meta for Developers, added two products — Webhooks (Leadgen) ...
1
vote
0
answers
42
views
How to conditionally change pointColor from Nivo Line Chart
I would like to conditionally change the pointColor of the Line Chart.
Depending of the data value from X Scale, the point should have a different color.
Example:
I've tried to use the prop ...
4
votes
2
answers
216
views
Synthetic event becomes stale after async operation
I'm experiencing an issue with a TextField where e.target.value
becomes stale after an async operation(FileReader API) in the onChange handler.
When I capture e.target.value in a variable before the ...
0
votes
2
answers
140
views
Why does useEffect on [] gets called on hot reload?
app/page.tsx
"use client";
import { useEffect, useRef } from "react";
import { foo } from "./OrdersModuleFoo";
import React from "react";
const OrdersModule: ...
0
votes
0
answers
78
views
Parallax effect between sections and Scrolling issue
I am working on a landing page using react and tailwind. You have a sticky navigation where you click links then view scrolls to that particular section which connected to the link because section has ...
1
vote
0
answers
84
views
How can I resize the zoom embedded component in my page to have the 100% widht/height of its parent div?
I want to resize the zoom embedded component to fit my div but the problem is the container width and height are 0 when i pass them to the zoom client.init function. What is the best way to resize the ...
1
vote
1
answer
82
views
correct MSAL configuration in a React App
I would like to create a React app with Microsoft's MSAL, but I am unable to do so. How can I integrate MSAL into App.jsx or index.jsx?
Thank you for your help