9,290 questions
1
vote
1
answer
110
views
SVG Divider flex container not matching height of input in React
I am building a Hero Section in React app and creating a search bar with a dropdown, input field and a vertical divider between them.
The search box is a flex container. I want the vertical divider(...
Advice
2
votes
5
replies
116
views
JSX Backend Framework: a Joke or a Problem Solver?
I’ve been experimenting with a way to make backend architecture as visual and readable as a React frontend.
A Joke : This was a Joke against the huge mess that the misusage of server actions in React ...
1
vote
1
answer
51
views
Unable to update data in redux toolkit
I'm making a CRUD app using Redux Toolkit. It includes all the basic operations, but the Update operation doesn't work as expected. Please take a look at the following code.
postSlice.js
export const ...
1
vote
1
answer
113
views
Incrementing a number inside a shared component
I am working on a project converting academic coursework in Markdown to MDX. This Markdown can feature footnotes.
The MDX-generated component tree contains <sup>n</sup> elements linking ...
0
votes
0
answers
45
views
How do I crop my image in .jsx so that my image is not 'cut off'
I have an image with the dimensions: 8192 X 12288 px.
I want to crop the image into these dimensions: 5400 x 7200 px.
Result 1 -
In Photoshop, using the crop tool, it does it like so (left image).
It ...
0
votes
1
answer
96
views
MUI - Round border radius FormControl
I have a FormControl which currently looks something like this:
Now the problem is in the image below, the label Username is getting set at the edge due to the borderRadius which is making the label ...
0
votes
1
answer
40
views
How does it work to update a draft but keep it as a draft on the same id? Strapi and react
While the draft I would like to edit does get sent with the redirect to the edit page, it keeps giving me a not found error.
output
Draft in Edit:
{id: 5,
documentId: 'uqmaazyp3zb01az41s0sfzbm',
...
0
votes
0
answers
61
views
How to replace basecolor image in a psd file
Now I have a Photoshop .psd file with a 3D Layer with the following Texture options:
My Photoshop document's 3D layer
English translation
I want to batch replace the image-file used for the Base Color ...
1
vote
1
answer
46
views
useState on multiple image load events doesn't save all values
I'm trying to save a value to state for each loaded image in my gallery, using the image's native onLoad event to call a custom handler function.
handleImageLoad is indeed fired for each image and ...
0
votes
1
answer
75
views
window.addEventListener("beforeunload", callback) nulls out hook state values when webpage refresh is used - need to close a pop-up window
Use window.addEventListener("beforeunload", xxx) within a function call with the intent of having programmatic functionality before the user refreshes the page or navigates away. In this ...
0
votes
1
answer
244
views
rspack builtin:swc-loader jsx compilation error
I'm using rspack to bundle my app. Im getting error in the build process while compiling my js/jsx components.
Here my rspack rule config
{
test: /\.(js|jsx)$/,
loader: 'builtin:swc-loader',
...
-2
votes
1
answer
80
views
React and Django DRF [closed]
The backend works, when i test it with an http file. and directly at the endpoint.
POST http://localhost:8000/api/products/ HTTP/1.1
Content-Type: application/json
Authorization: Bearer ...
1
vote
4
answers
110
views
Why does the input field lose focus after typing a character unless I add autofocus, but still the whole page reloads?
I have an input field that loses focus and reloads the entire page after every letter added, and when I add an autofocus the page maintains focus but still reloads the page. How do I fix this?
...
2
votes
1
answer
250
views
How to dynamically compile a directory of mdx files before each vite build?
I'm using React and Vite for a project I'm working on.
What I currently need to do is compile and render all of the MDX files in a directory but I don't want to do the actual compilation on the client ...
0
votes
1
answer
63
views
After scrolling to the top/bottom , content is partially hidden
{/* Requests List with Scroll */}
<div className="overflow-y-auto" style={{ height: 'calc(100% - 150px)', paddingBottom: '20px' }}> {/* Adjusted height and added padding-bottom ...
3
votes
1
answer
351
views
How can I convert a string to null OR number with Zod?
I have a select like this:
<select>
<option value="null">Select a option</option>
<option value="1">Apple</option>
<option value="2"&...
2
votes
1
answer
75
views
translate-y-full makes a slide up animation completely stop working?
I'm facing an issue where animations with translateY() refuse to trigger when the component has an initial state of translate-y-full.
Here's some example code:
const { ref: refHeading, inView: ...
0
votes
0
answers
839
views
Handling 429 Too Many Requests Error with Google Gemini API in Next.js Client-Side Application
I'm encountering a 429 Too Many Requests error when using the @google/genai package to generate interview questions in a Next.js client-side application. The error persists despite implementing a ...
0
votes
0
answers
65
views
How to add clean trail effect to R3F object component that is a scaled down glb?
I am trying to add a trailing effect to a glb model of Tinkerbell. I have the logic split into four components:
SimpleTrail.jsx which renders the trail effect on a particular target ref (working)
...
-4
votes
1
answer
119
views
Why I'm getting error every time i try to access the protected route instead of redirect to /login? [closed]
I'm implementing protection route in my vanlife practice project and its not redirecting me it keep giving me this error when i try to access protected route
I'm supposed to get redirected to /login ...
0
votes
2
answers
75
views
How to enable scroll in sheet? [closed]
I'm trying to run the scroll in the sheet, but I think the problem is caused by the gesture, that is, the children part definitely exceeds the maxSnapPoint, that is, it exceeds 90 in this section [50, ...
0
votes
1
answer
210
views
How to reduce jaggedness in SVG diagonal lines (anti-aliasing tips)
I'm working on a React project where I generate a dynamic SVG matrix with skewed/tilted cells. The skewing creates diagonal outer borders, but these lines have severe jaggedness (aliasing).
Here is ...
0
votes
1
answer
77
views
Script crashes Adobe Illustrator
I try to scale a bunch of svg file using adobe illustrator script written in jsx.
The Illustrator crashes and a lot space on my drive is used. (i don't know where)
The Illustrator opens the first file....
0
votes
1
answer
95
views
Tailwind dont recognize className and dont generate css
UPD: I fix this problem with downloading tailwind from github.
here is tut for linux:
curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/download/v4.0.0/tailwindcss-linux-x64
chmod +x ...
0
votes
1
answer
107
views
React-Native FlatList Each child in a list should have a unique "key" prop, I've already given keys to all mapped elements
I've followed the advice online and made sure every mapped element has a key in the parent container. My FlatList has the renderCard method, and an included keyExtractor that follows the syntax of ...
0
votes
1
answer
46
views
Click Events of JSX Elements rendered programatically in the dom not setting state right
This is a weird one but I'm a major novice when it comes to React, I'm probably just doing this completely wrong but I'm trying to dynamically render a content tree. It starts with a single node and ...
2
votes
1
answer
86
views
Why use this syntax `{": "}` in React instead of just writing a colon
I saw this code snippet on the React dev page (https://react.dev/reference/react/memo#updating-a-memoized-component-using-state):
export default function MyApp() {
const [name, setName] = useState(''...
-3
votes
1
answer
101
views
Accessibility problem with aria-label and aria-hidden
<li key="getprivacySectionView" className="nav-item dropdown header-privacy">
<button
className="nav-link btn"
onClick={this.trustArcPrivacyLink}
...
0
votes
1
answer
95
views
Is there some useEffect and useState behavior that explains why only one of these instances work?
I'm using useEffect to fetch data. This data is passed to a state, then used as a prop for a component to render/populate accordingly. Here is the code that works:
const [projects, setProjects] = ...
1
vote
1
answer
117
views
How can I allow non-standard attributes on a tag in Astro/TypeScript?
I'm in the process of porting my website across to Astro - it is mostly working fine, but there is one TypeScript error that I cannot figure out a proper fix for.
My website uses Utterances for ...
1
vote
1
answer
471
views
Tailwind CSS Intellisense autocomplete does not work in React+Vite project
Visual Studio Code Insider .v1.100.0-insider. Tailwind CSS Intellisense v0.14.15. Tailwind v3.4.17 installed via npm. Windows 11 64-bit.
Tailwind config:
/** @type {import('tailwindcss').Config} */
...
1
vote
1
answer
357
views
TypeScript can't handle new element in JSX.IntrinsicElements in new Vite project
Versions:
node v22.14.0
typescript v5.8.3
react v19.0.0
@types/react v19.1.2
@types/react-dom v19.1.2
react-dom v19.0.0
mathlive v0.105.0
I've made new Vite project with TypeScript / React and now I'...
0
votes
2
answers
75
views
Using user component in server component React
Problem
I want to add events to a client component that has a server component as a parent component, but I get an error.
Message Error:
Error: Event handlers cannot be passed to Client Component ...
2
votes
1
answer
2k
views
React Error: Multiple React Versions or Old React Element Rendered in react-vertical-timeline-component
I'm encountering an issue with the react-vertical-timeline-component in my React project. When trying to render the component, I get the following error:
Uncaught Error: A React Element from an older ...
0
votes
1
answer
169
views
Error to create a carousel with a pure-react-carousel
may you help me? I'm trying to create a carousel with pure-react-carousel but I'm getting the error: RangeError: Maximum call stack size exceeded
Below is the MRE:
Index:
<!doctype html>
<...
0
votes
1
answer
88
views
How to re-render table to reflect input data
I have two files/components:
Createrisk.jsx for creating individual risks
Tablepage.jsx displays the risks in an MUI Data Grid
The problem is Tablepage renders only the attributes from Createrisk ...
1
vote
1
answer
191
views
Is it necessary to import react in react 16?
I know since react 17, it is no longer required to import react, but in my currently project, I am using react 16, surpursingly I can still run my web app without importing react in my jsx code, I ...
0
votes
1
answer
49
views
Conditional rendering in JSX
I have an object that I want to render, 8 items per row. At every 8th item, I close the row div and start a new row. This is my code
<div class="usage-row">
{cpu.map((item, index) =&...
-1
votes
1
answer
109
views
React19 and Nextjs15 Hydration errors
sometimes a get random hydration error out of nowhere. and it doesnt specify like div inside a p tag. it just shows up even I add surpessHydrationErrors on both html and body tags. sometimes, I just ...
1
vote
1
answer
68
views
Nullish value narrowing on Typescript using logical conjunction on React
Can someone help me to clarify why typescript does actually narrow the type in this case:
subcollectionId is narrowed to whatever non-nullish value you expect to have
const subCollectionId = ...
0
votes
1
answer
126
views
Unable to render/see the default value of a prop in React
In my UserGreeting.jsx file, I have added the default values for my username variable, however, when I'm trying to render it by removing the username value in the app.jsx file, it's not showing up in ...
1
vote
2
answers
126
views
What am I doing wrong with my absolute positioning for my menu
I am working on a navigation menu in my React project using Tailwind CSS. I need the menu to be centered in the header area when it's toggled on small screens.
However, the best solution I could find ...
1
vote
1
answer
73
views
Why Does React DevTools Show the key for <Fragment> but Not for <li> Elements Inside a Mapped List?
In my React component, I have two mapped lists, each with key assigned:
The outer list maps over recipes, using <Fragment key={recipe.id}>
The inner list maps over ingredients, using <li ...
0
votes
0
answers
90
views
How to Highlight Text in HTML While Ignoring Tags Without Breaking Valid HTML? [duplicate]
I'm trying to highlight text within an HTML string while ignoring any HTML tags inside the text. However, my current approach sometimes wraps only part of the text and breaks the HTML structure.
What ...
3
votes
1
answer
88
views
How to overwrite a current character inside input box (OTP inputs) when it is already full?
I am trying to create an input box for a timer/OTP styled input.
How to overwrite a current character inside input box w length 1 (OTP inputs) when it is already full?
My problem is that the input is ...
5
votes
1
answer
6k
views
Whenever I run my React-Vite it says [plugin:vite:esbuild] The service is no longer running
After running the npm run dev, it shows this:
[plugin:vite:esbuild] The service is no longer running
My config files are properly set up although I don't have a config file for PostCSS also.
vite....
-1
votes
1
answer
293
views
Fetch does not get response from API
I am building a react-native app and I am new to React Native. While I am a seasoned developer, I do not know much about react-native. At some point, this was working, but then it stopped. I must have ...
1
vote
1
answer
66
views
Getting strange errors compiling a React application
I am attempting to run a React application using Typescript and Material UI.
I have created a custom component called tempSelector shown below:
import {Autocomplete, TextField} from "@mui/...
-2
votes
1
answer
1k
views
Default props in reactjs not showing on screen
I am trying to give a default title to the react js web application but it is not taking the default value.
This below is App.js where i was giving the value of title before adding a default prop and ...
0
votes
2
answers
160
views
How can I center a Material-UI Card component in the middle of the page?
I am trying to center a Material-UI Card component in the middle of the page but I'm facing issues. I am using the Grid component and setting up the layout, but the card is not centered vertically or ...