Category "reactjs"

YARN warning "has unmet peer dependency". What do with this?

Warning in console: warning "react-scripts > eslint-config-react-app > [email protected]" has unmet peer dependency "@babel/plugin-syntax-flow@

'Component' cannot be used as a JSX component. Nextjs

This is how _app.tsx looks: function MyApp({ Component, pageProps }: AppProps) { return <Component {...pageProps} /> } and I am getting this error whil

React: Updating state when state is an array of objects

I have an array of objects in state: this.state = { items: [ {id: 1, someattr: "a string", anotherattr: ""}, {id: 2, someattr: "another string", anot

Images not loading when deploying to Github pages

I am using create-react-app to develop my react app and deploy it to Github pages. My app works correctly on development. But when I deploy, it successfully dep

React: Updating state when state is an array of objects

I have an array of objects in state: this.state = { items: [ {id: 1, someattr: "a string", anotherattr: ""}, {id: 2, someattr: "another string", anot

NextJs CORS issue

I have a Next.js app hosted on Vercel at www.example.com, which needs to communicate with a backend .NET Core Web API hosted on a different server at api.exampl

Unable to install Recharts using npm

npm install recharts using npm I get the following in my console npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to res

tsc not found in typescript express and react app when deploying to heroku

I am working on an express app(in typescript) and a react app bootstrapped with create-react-app(in js). The directory structure is here. The server directory c

html-webpack-plugin Entrypoint undefined = index.html

I'm trying to set a webpack4 and React boilerplate, but facing issue rendering the index.html. For example, when I updated the title of the index.html and the i

Setting the active slide in swiper/react with react state

I would like to ask if there is a way to control/set the active slide with swiper/react? I have tried to handle the onSwiper function with props but still cant

How to call a function every minute in a React component?

I make a table to get stock price quotes, it works well, but when I try to put a function include setState in the component, it falls into an infinite loop, it

Preloading Google Fonts

Light House audit is suggesting that I preload key requests, specifically the two google fonts that I'm using in my React app. A Light House member suggested us

How to center a component in MUI and make it responsive?

I don't quite understand the React Material-UI grid system. If I want to use a form component for login, what is the easiest way to center it on the screen on a

React along with Stimulus js in Rails 6

Is there a way to use reactjs along with stimulusjs simultaneously in a an existing rails project? This is not a coding specific question rather an architectura

How to add helper text in date field in material UI?

This is my component definition: <DateField name={formElement.name} type="date" label={formElement.name} onChange={(date) => formi

Correct way to push into state array

I seem to be having issues pushing data into a state array. I am trying to achieve it this way: this.setState({ myArray: this.state.myArray.push('new value') }

How do I extend the color palette from mui with Typescript

I'm trying to extend the color palette that mui provides. The overriding of primary, secondary etc colors works well but if I want to create a custom set of col

How do I include my credentials in getServerSideProps in Nextjs? [duplicate]

In the async function getServerSideProps I need to make a fetch from the back-end where I include my credentials to instantiate a session. I h

No result using makeStyles Material UI in react 18

Hi Im exploring ReactJs and Material UI and Im following outdated tutorials. I having a problem with this material UI makestyles how do I use this? This is the

SVG element in list, when I hide the first parent, all of next SVG in each section will be hidden too, but not the container

I face a strange bug with Next. With getServerSideProps, I made a request to my api folder, this result a simple JSON. All is good. I display the content perfec