Category "reactjs"

How to add multiple classNames to nextjs elements

I have an unordered list element that looks like this: <ul className={styles["projects-pd-subdetails-list"]}> {detail.subdetails.map((sub) =&

Need help on a react.js error that I keep on getting

Every time I try running npm start on a new project I keep on getting this error. Does anyone know or have any idea how to fix this?? There might be a problem

Mocking react-router-dom hooks using jest is not working

I'm using Enzyme's shallow method to test a component which uses the useParams hook to get an ID from the URL params. I'm trying to mock the useParams hook so

How to add scroll into react-bootstrap Modal.Body

I'm using react-bootstrap modal. How can I make only body to scroll and not all the page? <Modal.Dialog> <Modal.Header> <Modal.Titl

React state not updating after a post request?

I'm trying to send a post request to my backend with axios, and my backend gets the values with no problem, but I want to set a state of (sent) to true when the

How to make MUI's Autocomplete display the label from the matching value in props.options?

I have a multilingual website where there are certain Autocompletes whose options array need to have its items labels translated, which is done very easily. How

Material UI DatePicker set to Required

i am using the Material UI DatePicker in my react app and need to set the date to be required? Do I need to create a custom validator checking value on submit

What does it change to declare a constant above or bellow a React functional component?

My question is what does it change to declare a constant above or bellow a React functional component (or a class component also) ? for example what is the diff

React app stuck on "Starting the development server"

I have a react app created by create-react-app. After running npm start (the start script is present in package.json as "start": "react-scripts start") the cons

Create a static library with React dependency

I created a library that uses the native navigation controller to navigate through react and native screens. The library is written in Swift and contains some o

what is difference between variant vs component in typography for library React Material UI

I am using React Material UI component. Typography component has 2 props, variant and component.What is the difference between these props.

Handle change on Autocomplete Component from material ui

I want to use Autocomplete component for input tags. I'm trying to get the tags and save them on a state so I can later save them on the database. I'm using fun

How could we pass FileReader's result to parent's state in React?

Hello and thank you for your time. I am currently learning React. I am trying to refactor a component to separate and put the state into a top level component

how to pass data from one page to another page in Next.js?

I am stuck with a problem with passing data from one page to another page in next.js as I am building a basic news application in which I am fetching get reques

Redirect to docs from landing page in docusaurus v2

Since I don't have a landing page, I would like to redirect to the main doc page docs/main I tried to follow the instructions: https://docusaurus.io/docs/en/si

React PDF + Vite implementation Error: Uncaught SyntaxError

I'm trying to use the React PDF lib in a project that react created with Vite. I'm having problems rendering the PDF component and the error is very weird, coul

wallet-connect importKey error when uploaded to test server, but local server it works fine

I was trying out wallet-connect for my nft market place app . i have mostly everything set up from my end . Just that my wallet-connect works perfectly in local

Node Error: resolve-url-loader: CSS error

I am trying to run a react project as dev server on my surface, and if gives me the error shown below and in the title. When I am running the same config on my

Google Tag Manager Form Submission with Formik

Try as I may, I am unable to successfully track any form submissions with Google Tag Manager when the form is submitted by Formik in a React project. I have tr

Combining 2 arrays into their own arrays React

I have 2 arrays that I used the map() function to add to an array, but the problem I'm having is they are being grouped by name and grouped by review but I want