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
-
-1
votes1
answer82
viewsHow to get the "value" of a select in Reactjs
I made the following code, I would like to take the value of the "value" of the select, (the car color and show in the H3 tag when the button is triggered) I tried to use .target.value but without…
-
-1
votes1
answer58
viewsHow to Insert Multiple Items using React-Native-sqlite-Storage
I was developing an application using the React-Native-sqlite-Storage but I came across a very strange problem, time my code works and time does not, I can not understand, to try to investigate I…
-
-1
votes1
answer36
viewsI’m losing the state with when returning page with <Link> of the React-router-dom - REACT
I’m creating an application in React using the github api, it lists the repositories of a particular user, each item (each repository listed) has a Link from the React-router-gift called "Details",…
-
-1
votes1
answer28
viewsSend a photo to the bank through onChange on React?
I am converting the photo to Base64 and displaying on the console, but the value in useState does not update immediately. It shows only from second attempt to upload the photo. import React,{…
reactasked 3 years, 5 months ago Vitoria Silva 3 -
-1
votes1
answer33
viewsCalling a function after entering a page
Good afternoon, I am working on a React Active application and I am having problems when I need to reload a value when it is already set, the function listingCurso can receive the course, but when I…
-
-1
votes1
answer25
viewsHow to define the component to be rendered in the React-Router-Dom Link?
According to the documentation, it is possible to render a custom element in the React-Router-Dom Link: If you would like use your Own navigation Component, you can Imply do so by Passing it through…
-
-1
votes1
answer45
viewsHow to return a message to the Fronteend after checking an API in Reactjs
I am making a registration form in Nextjs, working ok, the inputs takes the user input data via reactJS FETCH API and sends to a MYSQL database, Until here ok, what I’m cracking my head is time to…
-
-1
votes1
answer29
viewsHow to fire event once loading the form?
I have a form that receives parameters with which I perform a get on the server, bringing and rendering the information to the user. Currently this get is done by calling a function on onClick of a…
-
-1
votes2
answers27
viewsConditional returning error in Reactjs
My reactjs app only works if I remove the conditional. I figured it might be Babel’s fault, but if it was, JSX wouldn’t work even without parole. App.js: import React, {useState} from "react";…
-
-1
votes1
answer16
views255 error while running NPX
I can’t create an React app. I’ve tried npm cache clear --force and tb tried to install it globally, but nothing works. Error log: pm ERR! code EPERM npm ERR! syscall open npm ERR! path…
reactasked 3 years, 4 months ago PrihScapin 1 -
-1
votes1
answer30
viewsPlace one state array inside another
I wonder how I can put the contents of an array that is with true status within another array, for example: { id:1, Fruit:'Banana', status:true }, { id:2, Fruit:'Orange', status:true }, { id:3,…
-
-1
votes0
answers16
viewsstylization of other files
Good night! I’m new here in the stack and have little experience with React and Styled-Components. I have an excerpt of stylization below that I want to reuse in another part of my code without…
-
-1
votes1
answer25
viewsI’m not getting the form clean
I’m having a problem, I can’t clear the form after Submit. export default function Home() { const initialValue = { nome: '', sobrenome: '', email: '', endereco: '', numero: '', cidade: '', bairro:…
-
-1
votes0
answers5
viewsHow to protect routes that already exist in a next.js app without replicating getServerSideProps on all pages
I am mounting an authentication in an existing next.js app and need to protect the routes. The best way I found is by using cookie and the getServerSideProps method so that when a protected route is…
-
-1
votes2
answers44
viewsTaking values from an Input Array in React
I’m adding two new inputs for each product that is returning me from <li>. In these new inputs I’m putting a onChange to take whatever is typed and put in my useState, but I’m having a hard…
-
-1
votes0
answers16
viewsTaking a props of a component as a global variable
I’m starting at React-Redux and would like to pick up a props of a component as my Reducer value I will demonstrate my code : product import { createSlice } from '@reduxjs/toolkit' export const…
-
-1
votes1
answer20
viewsWarning: Each Child in a list should have a Unique "key" prop
I was doing a project and asked him to use a "key", I put it and always gave the error of Warning: Each child in a list should have a unique "key" prop, then I looked at the stack overflow to see…
-
-1
votes0
answers19
viewsHow to Update a Component with Hooks
I have a form that when saving a record should update the list of users. When it was in the same component the list would update normally. Now I need to refresh the page to get the updated list. I…
-
-1
votes1
answer54
viewsHow to run a function only after a Javascript API call?
I’m stuck in a situation here which is as follows: The project is done in React import hostApi from "api/hostApi"; const body = { token: localStorage.getItem("suavagaToken") } function…
-
-1
votes0
answers8
viewsContent does not appear
I’m banging head with Ionic-React has a while already, and I can’t understand why the code below does not generate the text on the screen. const AgendaDiaria: React.FC = () => { const {user} =…
-
-1
votes1
answer34
viewsHow to add only 1 time the same item in the cart ? (Javascript)
How would you add only 1 time the same item in the cart? import React, { Component } from "react"; import * as S from './styles' //Components import ImgCar from '../src/components/imgs/car.svg';…
-
-1
votes0
answers23
viewsChange parameter in API call with Reactjs
I’m using Axios to consume an API and create a personal project. endpoint is this: https://www.freetogame.com/api/games I added a "Learn more" button where I would redirect to a "page" where there…
-
-1
votes1
answer17
viewsReceive the value of an input variable and compare to a preset to generate an Alert and redirect
Good morning, I’m new to React Native and I’m trying to compare the value of a variable I received through a Textinput with an already preset to generate an Alert and redirect me to another screen,…
-
-1
votes1
answer34
viewsLife cycle and React variables (state and useEffect)
I’m having trouble understanding React’s life cycle. Project summary: React repeatedly retrieves information from an API (setInterval) with certain filters, where filters are also the result of a…
-
-1
votes0
answers19
viewsI can’t get specific data from the Json API using Next with React js
I am using this API https://akabab.github.io/superhero-api/api/ and I can even get the data of all the characters with the call https://akabab.github.io/superhero-api/api/all.json, but when I make a…
-
-1
votes0
answers7
viewsI need to take information from the nextAuth service profile function and forward it to the browser
Hello I am making an app that uses as authentication a backend of its own, and in the authentication with google I am using next-auth, it sends the tokenid to the api via post and with that the…
-
-1
votes0
answers36
viewsHow to make a component with a function
PURE CODE <input type="text" id="nf" placeholder="Nota Fiscal" /> <input type="text" id="cnpj" placeholder="CNPJ" /> <input type="button" value="Buscar" onclick="buscarNF()" />…
-
-1
votes0
answers12
viewsonScroll with Styled-Components + Typescript
I have a problem to use onScroll event with Styled-Components + typescritp. It happens to the following error message: 'No overload matches this call. Overload 1 of 2, '(props:…
-
-1
votes0
answers18
viewsI can’t make a sum
Hello, I am developing an application that makes a calculation of electricity consumption in React Native. In it, I have 2 pickers: one of hours and the other of minutes. And to make it easier on…
-
-1
votes0
answers21
viewsProcessing of subarray data
I have an array(thirdArray) and there is a subArray(data). I need to do a treatment, where every data you have with an amount above 0 he receives a status true but a status false. After doing this…
-
-1
votes0
answers13
viewsConditional rendering in a single map Component
to with a little problem here, to fzd a map of some data and wanted to put a conditional rendering on each, when the delete or Edit button was pressed, but when I click on the button of a map item…
-
-1
votes0
answers21
viewsa React state works perfectly on my localhost but when I do the hosting doesn’t work
Gallery export function () { const [estadogaleria, setestadogaleria] = useState (false) const [indice_galeria, setindice_galeria] = useState (0) const [indicehome, setindicehome] = useState (0)…
-
-1
votes0
answers21
viewsMy useReducer does not work
I’m making a shopping cart with useReducer and I can’t change the inCard for true and the qty to add one more to each click. What am I doing wrong? import React, { useReducer } from 'react' import…
-
-1
votes0
answers12
viewsHow to use Redirect in my React application
I’m making an application in React, I’m using the Redux and the saga Redux. I am protecting the routes, but when I do the redirect does not take me to the main page of my appeal. That’s the code of…
-
-1
votes1
answer17
viewsaddeventlistener in querySelectorAll in Reactjs
Fala galera Maybe it’s a simple problem but I’m trying to figure out why it doesn’t work, I researched here in the stack, I found similar questions but they didn’t solve the problem. I have a…
-
-1
votes1
answer9
viewsHow to make Nextjs not return props before getStaticProps has completed all requests (Promises)?
Within the function getStaticProps I take some data from the database and perform in them some treatments to suit the way I will use them. Everything happens exactly as it should, except that…
-
-1
votes0
answers4
viewsValidation and rendering of a field if a particular option of the select is selected (React-Hook-Form and React-Select)
I need the user select the option "Promotions" in select, the field "Promotional price" is mandatory completion and the display his block. Here’s how I’m trying to do it: const { register,…
-
-2
votes4
answers7619
viewsRemove Focus/Outline from input (CSS)
How to remove this input Focus/Outline? This is my HTML I’m using Reactjs, Bootstrap-React <div className="viewInstrument-table-heading"> <div className="table-heading1">…
-
-2
votes1
answer94
viewsReact and React Native communicate easily?
I need to make a web application, but it needs to run on platforms Android as IOS. Although I know the difference between Frameworks, I wonder if I can make a code using the React normal, but…
-
-2
votes1
answer206
viewschange icon color with design ant
I would like to change the color of an icon when I do a Hover, I am using ant design <button className="button1"> <div className="content"> <Icon type="plus" style={{fontSize: '64px',…
-
-2
votes1
answer21
views(REACT) Should I compose only the repeating tags?
As the title itself says: Should I compose only the repeating items? an example: <navbar> <a href="LINK"> <img src="imagem.jpg" alt="Minha Figura" /> </a> <ul>…
-
-2
votes1
answer92
viewsEslint problem in Reactjs with useEffect, in this case how do I not need to put the // Eslint-disable-line
Well, folks, I have a function that allows for some variables within it. However, it should only be executed when a dependency specific to it is changed. in the case of index useEffect(() => {…
-
-2
votes1
answer75
viewsPassing state of a class to a Modal in React Native
I am starting in React Native and I have a problem, I will put the prints to make it easier. I have a screen called Questions, which has an initial state, and this screen opens a modal called…
-
-2
votes2
answers83
viewsList to frontend values of multiple tables
Good afternoon, I am a beginner in Act and Noode.js and I have a problem. I have a table on a web page where you’ll receive the data from a trip. The columns (Id localities, name, date, time) are…
-
-2
votes1
answer39
viewsSave value I already selected in combobox
I would like to save with the data that is already selected but does not work, I have to put in yes and then go back to no Method handleChange(e) { let obj=Object.assign({},this.state.area)…
-
-2
votes2
answers32
viewsRETURN VALUE TYPED WITH JAVASCRIPT
Hello, I needed a help. The idea in Javascript is as follows... The user type a value in a input, and the application returns the value corresponding to this type value, which has already been…
-
-2
votes1
answer16
viewsDeploy Django+React js
Hi, I’d like to ask you a few questions. Suppose I want to make an api for a store application using Django and the frontend using React js. How would the application deploy work, I would need to…
-
-2
votes0
answers19
viewsHow do I leave a 1:1 image in React Native?
I have an image that I would like its width to be 100% the width of the screen and the height to be the same size as with (that is to say 100% the width of the screen), someone could help me with…
-
-2
votes1
answer599
viewsRoutes in Reactjs
I’m studying ReactJS and I’m having a problem with the routes. I managed to implement the route, but when I click to open a page, it remains rendering the page that was open before and only after…
-
-2
votes1
answer502
viewsREACT ERROR == EXTERNAL API PAGINATION
Please I need help to make a pagination of the information results in an external API (pokeapi.co) I can find all the items, I limited the responses in a hundred units and now I want to page ten by…