Category "reactjs"

CSS showing differently for Deployed then localhost when moved from material-ui version 4 to mui version 5

Image for Development Environment: Image for localhost: As is visible jss6 css is what is coming from makeStyles-sidebar 6 but on deployed version there is so

(Yup) how to create multiple errors using a single .test() function

EDIT: while the accepted solution worked, this worked much better in my use case I have one function that validates that neither input field A nor input field B

useinterval in react (polling request)

I've created a simple react (nextjs) app that sends some data to a backend server. While the data are being processed the react app keeps track of the progressi

Css not updating react component

/* Here is my container in my react component */ <Container fluid className="graph-container"> <Tabs id="graph-buttons" var

I need to subtract the count and update the remaining count

I am using TextField that field data I am adding into the table that works fine what my task is I have one field called Total no of count their I am storing my

Using design frameworks for teams

We are building our web app and want to choose right design frameworks. Our plan is to build a stand alone web application and then to integrate it with Microso

Node/Express Cannot POST error (React frontend)

For my React/Express app, I've already built my backend API in Express, including a route for posting a blog post (/api/posts). On the front end, I built a form

React - Cannot find module fs and require is not defined

I am using React to build a web app. I never called fs in a file and everything worked fine until I suddenly got this error: Uncaught Error: Cannot find module

How to implement authentication for the nested routes in React-Router 6?

I am trying to implement authentication for my routes like this using react-router v6 <BrowserRouter> <Routes> <Route path=

Type '{ author: Author; }' is not assignable to type 'IntrinsicAttributes & Author'

I am totally new to TS and react and I ran into a problem. I tried searching many places and can't seem to fix it. The whole error message is: Type '{ author: A

How can I merge multiple reducers?

I have a file structure like below store index.js reducers organize index.js user index.js index.js trying to combine organize and user reducers to reducers/

React State update with button click from another component

Please read the details below of code enter image description here This MegaMenu Component import MenuIcon from '@mui/icons-material/Menu'; import './MegaMenu.c

Linking components in React using React Router Link not working

I am new to React and I am creating a portfolio web page in which I am trying to connect two components with the Link component in react-router-dom (similar to

how to re-register the service worker with next-pwa

I am using next-pwa package with my next.js applications for PWA features. But I am having a problem here. Everytime, I rebuild and redeploy the application, it

what is the correct way to use Sass and React JS?

I have a question. I´m Learning how to use React JS 18v. My question is: what is the best way to use Sass with React? how do you compile it? I don't want

Document is undefined when using apollo query with next.js getServerSideProps

I am trying to use getServerSideProps to fetch a query every time this component is rendered using apollo and next.js export async function getServerSideProps(c

create table from JSON object in react

I am creating a table dynamically in React with the API response as it is as it receives. data = {"name":"tom", "age":23, "group":null, "phone":xxx} It is work

Attempted import error: 'Switch' is not exported from 'react-router-dom'

I don't know why I am getting this error and I can't find an answer for it anywhere. I have uninstalled the react-router-dom package and reinstalled it, but it

Trying to run function only if state changes

I want to run the set totals function only if the hour's state has changed. It is running every time the component mounts instead of only if the value changes.

Using function defined in custom hook does not update some value in the state

i recently started using react and i'm trying to write a custom hook used for translating some ui elements. I'm not using a library because it is a larger proje