Category "reactjs"

401 unauthorized browser alert after fetch call with bearer token in react

I have a get fetch request with header having Bearer token, getting 401 unauthorized error, even if the response status condition checked in the then statement,

Module.css not loading styles NEXT js

I'm trying apply module.css to one of my components according to this guide https://nextjs.org/learn/basics/assets-metadata-css/layout-component. /*/components/

Icon should have `type` prop or `component` prop or `children`?

Warning: Icon should have `type` prop or `component` prop or `children`. How to troubleshoot the issue? import React from 'react'; import { bindActionC

Only allow specific components as children in React and Typescript

I would like to only allow specific components as children. For example, let's say I have a Menu component, that should only contain MenuItem as children, like

React - component doesn't re-render after delete request

I have problem that after deleting element from my list, component doesn't want to re-render. When I go through routing to some subpage and then back, item is a

fetch API always returns {"_U": 0, "_V": 0, "_W": null, "_X": null}

The below code always return the below wired object {"_U": 0, "_V": 0, "_W": null, "_X": null} as response. Here is my code getData = () => { f

jss how to change opacity for a color

Currently I am using the following code to add a color to an element using jss. const styleSheet = theme => ({ root: { backgroundColor: theme.c

how to get data with nodejs in webscraping

I am trying to scrape this link but I get the data from main tab and I don't know how to solve this problem I tried this with python , nodejs but both have the

react-scripts: not found when building docker image in CI, but works locally

I have a Dockerfile to build a React app and copy the build to an Nginx container. FROM node:14-buster-slim AS node-base FROM node-base as deps WORKDIR /app C

REACT: How can I download existing PDF files from my project folder?

I have tried it like so: <a href="./cv.pdf" download > download </a> That's what I have in this case Can someone help with the solution?

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