Category "reactjs"

React JS - MUI How to fix problem with expand/collapse and open drawer

I have 2 problems in the code that I can't solve. The first is the opening sidebar menu. The menu opens but does not close. It should close either with a click

Iterate over children, find last element

I work on breadcrumb component and I iterate over children like: renderChildren = () => { const { children, divider } = this.props; return ( React.C

Material UI Select component crashing React application

I'm trying to add a material ui select component to the React application I'm working with. When I try to add a select functionality to a form, it crashes. Desp

React / React-DOM package dependency conflict

I've been running into this error message every time I try to run npm update: : npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm E

The user aborted a request - ReactJS

I got an issue on my javascript program my project separate to 2 files: backend -> NodeJS (work fine I check the routes using POSTMAN and I got the Data. fro

Passing state to another component

In my MUI Table I navigate the user to another page when is clicked over the row. Is there a option to pass the data from the row directly with useNavigate, ins

Styled Components / React - Style on external element

I'm using Material UI components and MaterialTable and I want to stylish the components using StyledComponents But I not been having the desired results when I

Styled Components / React - Style on Fragment element

I have a question with StyledComponents, it's possible to create a style using a React.Fragment or any other existing component? I use this example (The intent

Firebase v9 on react JS

I just want to check if i dont create an other chats on my firebase. I query all my chat with this email and then, i check if the array contain the email i wann

A component is changing an uncontrolled input of type text to be controlled error in ReactJS

Warning: A component is changing an uncontrolled input of type text to be controlled. Input elements should not switch from uncontrolled to controlled (or vi

Monaco editor dynamically resizable

I have been searching for a discussion about if it's possible to mimic the html tag textarea's resizing when using Monaco Editor's field all over the Internet b

Next JS messing up responses for concurrent requests

I have a NextJs app that uses SSR for all pages (so no static pages to worry about caching). Inside App.getInitialProps I get the user-agent to make an educated

Jest finds tests but doesn't collect coverage

I trying to collect test coverage for this project using yarn test --coverage # i.e. "react-scripts test --coverage" My jest config is this: "jest": {

React-icons error 'Cannot use import statement outside a module' in stackblitz

I'm trying to add icon in my social header, but I am getting this error: Cannot use import statement outside a module and here is code: import React from 'rea

Message prints in every Dynamic Accordion in ReactJs

I have a dynamic Accordion in ReactJs. I am getting the message from my backend. but it's printing in every Accordion. I'm sharing the code import React, { useS

Retrieve env variables in Strapi plugin

I develop a Strapi local plugin but I'm unable to retrieve variable defined in my .env file at the root of my project. I try to load this value in my React comp

"React has detected a change in the order of Hooks" but Hooks seem to be invoked in order

I am trying to use Context and Reducers via React's hooks, and running into problems with the order of the hooks not being constant. My understanding was that a

How to run a function when user clicks the back button, in React.js?

I looked around and tried to find a solution with React router. With V5 you can use <Promt />. I tried also to find a vanilla JavaScript solution, but not

Using a Raspberry Pi 4 to host react web app [closed]

I have some broad questions on the flow of how to set up my web app on Raspberry Pi. I've built a React App on my local PC, it hits up an node

React-router HashRouter When redirecting root URL with query parameters, route gets appended after params

I'm having the following issue. I am implementing SSO which, after successful sign in, redirects the user to the root uri with the access_token as a query param