Most voted "react" questions
It is an open source Javascript library for creating user interfaces. It is maintained by Facebook, Instagram and a community of individual developers and other companies
Learn more…1,420 questions
Sort by count of
-
0
votes1
answer147
viewsCors Error - Visual Studio . Net Web API React
I have a project where the back is in . net and the front in React. I can do all CRUD operations with Postman, however in React I get Cors error. I understand the cause of the problem, but I cannot…
-
0
votes1
answer155
viewsHistory does not work
Guys my big problem there is the following, I other application I used the "history" property to redirect to another page, I learned that I didn’t need to matter anything from any lib to use history…
-
0
votes1
answer40
viewshistory and preventDefault if undoing!
So guys the problem is the following I take some data I go in the database and check if the person can authenticate, however I use the preventDefault() for the page not to update and the data not to…
-
0
votes1
answer302
viewsPlacing items in an array with Reactjs
I’m trying to put items in a array by clicking the button, but the same one is starting empty. Notice that I clicked 3 times but it shows me that the array has 2 positions. I have a div which is the…
-
0
votes1
answer212
viewsPrivate routes with reactjs?
I’m trying to create private routes with ReactJs, but always gives the same error, I’ve been on several sites and always do according to each tutorial, but still the same error continues: My code is…
-
0
votes1
answer347
viewsComponent in Reactjs re-rendering child components without need, how to get around this?
When a component Father consequently updates its Son(s) (s) also and(are) updated(s), without at least changing any value of its props and states, for example: function Filho({item}) {…
-
0
votes1
answer79
viewssetInterval() does not work
I am creating a question application, where it displays a timer, if the timer reaches 0, the question will be lost (ie if the user does not answer in time), but when displaying the number is…
-
0
votes1
answer343
viewsHow to change the style of a component without creating another component with Styled Components
I have in the file Loginwrapper.js the import of a Grid material design: import Grid from '@material-ui/core/Grid'; I have in the Loginstyles.js file a css change for this component: import styled…
-
0
votes1
answer288
viewsWhen changing an option of my material select I get: Use the `defaultValue` or `value` props on <select> Instead of Setting `Selected` on <option>
I have the following material-ui-React select component: <FormControl fullWidth variant="outlined" className={classes.formControl}> <InputLabel ref={inputLabel}…
-
0
votes1
answer663
viewsHow to receive data in an React Native component?
Hey, there, you guys! I am studying React Activate and I came across a problem that I could not solve, I tried in every way and searched in several places :( I have a list of employees and each…
-
0
votes1
answer141
views"Can’t perform a React state update on an unmounted Component" when I try to change the state in useEffect
I have a React UI Material Server and I need that when the component is mounted, check the localStorage and take the value of the logged in user to show in the template. This is my component: const…
-
0
votes1
answer37
viewsUse useEffect every time my Location.pathname is changed
I have a variable called nameScreen that I need to change its value every time the location.path is changed (whenever there is a route change): <Typography variant="h6" noWrap> {nameScreen}…
-
0
votes2
answers94
viewsChange State of Component called more than once
I have this code that is a simple counter of Truco. I made a component to count and called him to both teams. When it reaches above 11 points the Zera component was straight. But how am I calling…
-
0
votes2
answers36
viewsHow to read a default export js file
Good morning, I’m developing a component with React, but I’m not able to assign values from a file I created for default information. Example: created this menu-items.js file `export default {…
-
0
votes1
answer106
viewsMy input only accepts one character at a time. And is repeating the same text for other Input
I can only type in the input by placing one character at a time. and the same value I put in one, repeats for the other inputs. I have tried several alternatives to change handleChange and etc but…
-
0
votes1
answer31
viewsShow and hide only the desired widget
I’m making a kind of list where when I click anywhere the desired item is to appear information only from the one I clicked, but the way I did is changing the variable "open" globally, then the…
reactasked 4 years, 8 months ago OcoringaJoker 53 -
0
votes1
answer199
viewsReactjs and Redux state does not change
Good afternoon guys I’m beginner and I’m having a problem when it comes to updating my state could help me or give some hint on how I can fix this Home js. import React from 'react'; import {Form,…
-
0
votes1
answer125
viewsHow to remove blue border from React Material Modal?
I’m using that React Material Modal. In the examples, when opening the modal, it is wrapped in a blue border, there is some way to remove this effect? I saw on the Modal api that owns a property…
-
0
votes1
answer36
viewshow to make my function return increment?
is the following I’m having a hard time finding where is the error of this code, I want to make a counter, but every time is saying that setCounter is not a function. import React, {useState}from…
-
0
votes1
answer505
viewsChange component properties on different pages
I have a button component: Filing cabinet index.js: import React from 'react'; import {ActivityIndicator} from 'react-native'; import {Container, Text} from './styles'; import PropTypes from…
-
0
votes1
answer387
viewsCounter does not update data on the page using Reactjs and useState(), only when I place a console.log() can I see the result
I’m taking a Reactjs course, and I’m trying to follow all the code examples, but my code is the same as the instructor’s and yet mine is not working the same as his. Every time you click increment,…
-
0
votes0
answers199
viewsCleaning function in useEffect is not working
Hello! I am trying to cancel my api call using Axios when the component is unmounted, and although it seems to be being canceled, I still get the error: Can’t perform a React state update on an…
-
0
votes1
answer168
viewsReactjs - setState does not work with the first value in onClick
Bom di! I’m using React in version 16.11.0 and every time I use setState using function, the first value I Seto, it always comes blank. Follow the example below: //Declaração do State const [senha,…
-
0
votes0
answers196
viewsRedirect to another component by passing ID via table button in React
I have a process component that should redirect me to another component, this other component will need to receive the process.ID, in order to render the records referring to the process. I created…
-
0
votes1
answer160
viewsProblem when viewing API Nodejs with Axios
Problem I am not consulting my API nodejs with Axios. I have tested the backend numerous times with Postman and everything works correctly, Focusing with Xios always returns the same error. If…
-
0
votes1
answer291
viewsReact hook form checkbox always true
I have a question when receiving the database data for my checkboxes. Even the value coming false from the bank, the checkbox is checked. I’ve tried several forum responses but I must be missing…
-
0
votes1
answer2264
viewsHow to change an icon within a React application?
Talk guys, everything jewels? I have tremendous doubt, and I have no idea how to fix it. I recently participated in Omnistack Week 11 and was able to develop an application from scratch, from…
-
0
votes1
answer921
viewsCreate a loading(spinner) in an asynchronous request with React
I have an application with the front in React and the back with Node, and I needed that the moment the user pressed the button, the loading appeared and then the request was performed, or while the…
-
0
votes1
answer136
viewsAssign values of an array within a specific index of another array - React JS
I am developing a simple private chat in Reactjs and Socket.io. However a problem has arisen to resolve the following situation. First, I register users in the database through the Registry…
-
0
votes1
answer838
viewsHow to make a table where the cells are inputs in React with Material UI
I need to create a table with Material UI that will actually be a matrix, the size of this matrix will be dynamic and precise that the cells in the table are inputs to be completed and inputs will…
-
0
votes1
answer383
viewscreate routes with React-router-dom
The situation is this, I’m using the React-router-dom in an app in Reactjs, I’m learning to use Reactjs. So I create two 'Logon' and 'Welcome' routes, but every time I use React-router-dom I can’t…
-
0
votes1
answer188
viewsMy component within my modal is rendering twice
I have a parent component that opens a modal based on the value of this variable: const [openFullScreenModal, setOpenFullScreenModal] = useState(false) I have a button in this component that arrow…
reactasked 4 years, 7 months ago veroneseComS 2,752 -
0
votes0
answers107
viewsUpdate status when switching React
I’m taking the name of the person through the localstorage and passing to the state to show on screen the problem is that when I change page, Going from login page to home it does not show on screen…
reactasked 4 years, 7 months ago user163405 -
0
votes1
answer828
viewsHow to use Localstorage in a functional React component
How can I use Localstorage in this case the way I did works only with class component Error that appears is: Typeerror: repositories is not a Function export default function Main() { const…
-
0
votes1
answer692
viewsPage with Nodejs with Mysql database
I’m creating a API to then be consumed in React. In this API you will have a route(page) that will list database users. I applied the rules and I’m testing in India, which by the way is working…
-
0
votes2
answers1493
viewsChange the entire color of a React tab
I want to make my page in darker tones, my folder structure is: index.js ReactDOM.render( <Provider store={Store}> <PersistGate loading={null} persistor={persistor}> <App…
-
0
votes1
answer219
viewsReact Native - Appregistry.registerComponent with Provider
I would like to know why when I use the Preview like this //Root.js import React from 'react'; import { combineReducers, createStore, applyMiddleware } from "redux" import { listaDesejosList,…
-
0
votes1
answer203
viewsHow to use "shouldComponentUpdate" with Hooks?
I have a component <Filho> who does not receive props, but is rendered again whenever the <Pai> has some status update (useState). To solve this I figured I could do, in the component…
-
0
votes0
answers298
viewsHow to know when the virtual DOM and real DOM update happens?
I’m developing a project in React and noticed that using multiple setState() followed caused the surrender of my component again, for example: function MeuComponente() { console.log("Componente…
-
0
votes1
answer246
viewsTypescript - Representing the rest of a component’s parameters in an Interface
I have a component of Input using the TextInput of React Native. This component must accept the property append, and any other property passed to it shall be assigned to the TextInput: interface…
-
0
votes1
answer66
viewsNode.js processes are not being closed
I was studying React (I used the command npx create-react-app) but I closed the prompt I typed the command npm start. When I saw the files on my computer, there were more than 20 Node processes. I…
-
0
votes1
answer320
viewsDifference between Formdata and form
These days I was trying to upload data contained in a form. I used Node and React stack-like. The form contained the following fields: product, description, cost, quantity, image(file type). I used…
-
0
votes0
answers162
viewsReact unnecessary re-rendering
I’m doing my first major application in Act, and I’m having a problem where ALL my components are being rendered unnecessarily, causing the UI to crash for 1 or 2 seconds. I got two big problems…
-
0
votes2
answers532
viewsHow to render html inside a functional component in React?
I’m using the version 16.12.0 React. I own a functional Component called Card and would like to insert html into it (I would like to not change its source code). Card: function Card ({cardHeader,…
-
0
votes1
answer88
viewsExpo - Invalid hook call inside function components
I was learning Expo, and I needed to create a dynamic list of counters. On my screen I have a button + that adds other squares, and each of these squares has a counter inside them, from what I…
-
0
votes1
answer61
viewsHow to use useRef correctly with React in ionic5?
I’m using the following dependencies: Ionic/React: 5.0.7 React: 16.13.0 typescript: 3.8.3 I own a select: <IonSelectOption ref={refExemplo} {..propsDeExemplo…
-
0
votes1
answer811
viewsHow to provide more data correctly to a Flatlist?
I’m building an app on React Native using the services of Firebase and Redux. Every day, I register new Documents there and so my database gets bigger. In my app I was giving a rescue all records of…
-
0
votes1
answer898
viewsHow to get the values typed in input type="date" in React JS
Hi, can someone give me a hand? I’m trying to get the values typed in two inputs with the type="date" and perform a filter bringing only the table data that is between the initial date(typed) and…
-
0
votes1
answer173
viewsResponsive menu #bt_menu:checked ~ . menu does not work
Talk to you guys, I’ve been looking into this, but I haven’t found any answers other than what I’ve done. I’m making a responsive menu without javascript (I don’t want to use js because I know…
-
0
votes2
answers55
viewsHow to use Reactdom to create Buttons through conditions
How can I create these Buttons within my <div className="box-statusA"> when arriving in the indices of the status chosen import React, {useState} from 'react'; import ReactDOM from…