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
answer3720
viewsObjects are not Valid as a React Child (found: Object with Keys {price, item}). If you Meant to render a Collection of Children, use an array Instead
I have a page (hall) where orders with the customer’s name, table number and chosen items, are sent to firebase and I need to pick up these orders and show on another page(Kitchen). Part of the hall…
-
-1
votes1
answer834
viewsMultiple file uploads with React.js and typescript
I’m using middleware multer to upload files, but on the front end (with React.js) when using the form-data to get the files selected by the user , but I can’t send to the back-end, I’ve already…
-
-1
votes1
answer72
viewsHow do I make the React application scroll down if the content doesn’t fit on the screen?
I thought it was natural that when the contents of HTML did not fit on the screen, the browser would automatically allow scrolling for easy viewing. In the following case, for example, I have the…
-
-1
votes1
answer40
viewsProblems with SQL query with Knex in React
Next I have two tables one of Students and another of users and I am trying to make a simple login call by checking the user’s email and password through the foreign key between Students and user.…
-
-1
votes1
answer168
viewsReact performs Socket.io’s Callback function more than once
I am developing an application that works with React js in the frontend and a server in Node.js in the backend. On this server, I am using Socket.io to send notifications to the frontend when a…
-
-1
votes1
answer18
viewsReactapp syntax error
Good evening, I need to make a website for the web matter, but I came across the following syntax error, which I have no idea what it is, I’m still beginner. Main component import React from…
-
-1
votes1
answer74
viewsIf ternary in jsx is not working
I’m new to React and I’m trying to implement a route control, so I created an Auth file: const Auth = { isAdmin: false, authenticate(){ this.isAdmin = true }, signout(){ this.isAdmin = false },…
-
-1
votes1
answer198
viewsAxios does not pass data to API Asp. Net Core
I searched every corner of the network for an answer and couldn’t find one and created an application with React that calls an Asp.Net core Webapi, using Axios. It turns out that the parameters do…
-
-1
votes1
answer176
viewsRoute problem when loading Bundle.js
I have a route that has the bar character "/" in the middle, as shown below: <Route path="/answers/:question_id" component={QuestionAnswers} /> The link works normal. <Link…
-
-1
votes1
answer55
viewsVideo does not appear when I build the project
I created a site using Reactjs, and in the initial part I put a background video and a text in front, when I open the site Reactjs in my machine the video appears normally without any problem, when…
-
-1
votes1
answer61
viewsTextfield Select default value in Material-ui
It’s a basic question, I’m trying to leave the default value empty, but it always ends up filling with the first item: <TextField select id="letter" name="letter" label="Letra" defaultValue=""…
-
-1
votes1
answer26
viewsOrder products (Array)
Good morning, I have the following lines of code to return an order listing with the respective products. Products is an object within requests in the comic book. {transactions.map((order) => {…
-
-1
votes1
answer373
viewsHow to catch the current Geolocation of the cell phone using React Native?
I’m trying to get my latitude and longitude, so I used the following code: import { View, Text, TextInput, StyleSheet, TouchableOpacity } from 'react-native'; import MapView, { PROVIDER_GOOGLE }…
-
-1
votes1
answer763
viewsReact Axios Network Error
I am doing my first course of Reset with Xios and found problems making get calls. The relevant code is: api.js: import axios from "axios"; const api = axios.create({ baseURL:…
-
-1
votes1
answer119
viewsI cannot render elements dynamically using foreach
I wonder if you have how to render the component Drawer.Screen inside Drawer.Navigator, dynamically. I tried to put the components in an array (materias/index.js) and traverse them with .forEach(),…
-
-1
votes1
answer286
viewsAXIOS SENDS 2 REQUESTS INSTEAD OF 1
Summary : When I Make Backend Requests with Postman all goes well, but when I make requests with Front-End Reactjs Axios 2 requests come to the API, 1 without Token and the other with Token. I am in…
-
-1
votes1
answer55
viewsAPI items do not appear in the Table
I need to fill a table with all the items in my API, but when the process is finished the table returns empty. I did a fetch to access the API and tried to put all the items inside an array within…
reactasked 4 years, 1 month ago user188554 -
-1
votes1
answer88
viewsDocument.querySelector returns Undefined
I need to recover an input value from my login screen and move to my home screen. I made a document.querySelector to access my input through ID and stored this value in a const chamanda empresa.…
-
-1
votes1
answer291
viewsTypeerror: values.reduce is not a Function
I need to sum up the values of several objects from within a list. For this, I made a map go through my list and set that if the object has the true property it should do a reduce of all these…
-
-1
votes1
answer36
viewsgetBoundingClientRect returns different values
I am creating a button in React that when clicking generates an effect ripple. I use the getBoundingClientRect to pick up the position, but when I click a mouse very fast in the same place, the…
-
-1
votes1
answer87
viewshow to get an id with knex and typescript?
I am creating my database with Knex for an application made in React with Typescript. The application will be a service contracting site, where a service provider registers his work and a user…
-
-1
votes1
answer42
viewsHow do I get two numbers typed by the user via form and send to a function that will pick a random value between them in React
At the moment my code is like this, but it’s very messy, although I think it’s possible to understand the intention. The question is: How do I get two numbers typed by the user via form and send to…
-
-1
votes1
answer30
viewscurrentUser firebase is returning null
I’m doing a project that consists of creating two applications, I’m using firebase as a database and both are using the same database, the first application is working normally, but the second is…
-
-1
votes1
answer62
viewsFunctional component state losing values after upgrading it: "Cannot read Property ..."
I have a problem with a React application. Whenever I activate the onBlur={}, error occurs TypeError: Cannot read property 'valido' of undefined'. How can I solve? Code of Signup.jsx clients import…
-
-1
votes1
answer406
viewsReact - Dynamic table - Adding and removing rows from the table
I wrote the following code below, it is 100% functional with one exception. By clicking "remove" on the desired line, it removes the last line, not the correct one (that is, add 5 lines, ask q to…
-
-1
votes1
answer505
views.map() is not a Function
I am developing an application in React.js and have to perform a JSON request. The variable I declared receives the object, but when it arrives at the function .map() to expose the desired content…
-
-1
votes2
answers92
viewsDynamic consumption of REST React API
I am new in the area and know how I can do to have a dynamic consumption of the Rest api in React. Currently my query is fixed and my idea would be to take the value that the user type for query,…
-
-1
votes1
answer490
viewsError when setting values a loop "React Limits the number of renders to Prevent an Infinite loop"
Well, I have a useEffect that searches my data from an API and then set the values to a useState, but it’s entering an infinite loop and I can’t get my values in the other variable I created. export…
-
-1
votes1
answer168
viewsButton Ubmit and building components dynamically in Reactjs
I’m making a revenue registration page. This is my form: <form onSubmit={handleSubmit}> <Input name="title" label="Nome da receita:" type="text" value={title} onChange={(event) => {…
-
-1
votes1
answer78
viewsHow to change the style of a Komponent that was imported into React with Styled-Component
I created a component called "Searchbox": const Input = styled.input` border: 1px solid black; width: 450px; margin-right: ${props => props.marginRight == "ativo" ? '100px' : '0px'}; `; I…
-
-1
votes1
answer31
viewsStrategy for big queries
I’m working on an application that features a map and needs to render hundreds of thousands of markers. The data for rendering is in the database and the query is costly. There is also the challenge…
-
-1
votes1
answer20
viewsI am trying to map this object array but get: Typeerror: Cannot read Property 'map' of Undefined
import React, { Component } from 'react'; import PurchaseListView from '../purchaseListView' import './style.scss'; const purchaseData = [{items:[{gtin:'15024',…
-
-1
votes1
answer53
viewsHow to use model-Viewer in React?
Good afternoon. I’m unable to use the tag in React. Does anyone know what the problem is? I had followed this tutorial Using only HTML works normal: https://i.imgur.com/Rgkhkja.png However, when I…
-
-1
votes1
answer47
viewsReact.js does not return data in the map() function
Hello, everyone. I’m a beginner in React.js and would like help with this problem: I have a service that runs some Selects on tables from an Oracle database and, with the result of these Selects,…
javascript react api maps-javascript-apiasked 3 years, 10 months ago Francisco Marcelo de Barros Ma 1 -
-1
votes1
answer48
viewsBy clicking the button I get a message from "Referenceerror"
Context I created an application that displays a listing made from the variable - it’s in the application state - projects along with a button "Add button". By clicking on it I’m getting the message…
-
-1
votes1
answer648
viewsGet a zip code?
I’m having a hard time implementing a ZIP Code consultation on React What I wish to do and the user informs the ZIP code number in the field <input/> and automatically form fields are filled…
-
-1
votes1
answer79
viewsState returning late value in Click
I have a code from a memory game where a sequence of numbers is shown, and the user repeats it through a keyboard created. However, the click value is only captured after double clicking. I would…
-
-1
votes1
answer243
viewsProperty 'filter' does not exist on type 'Setstateaction<Never[]>'
I’m having trouble getting this little piece of code to work: Here is my code: import React, {SetStateAction} from 'react'; import {BsCheck, BsTrashFill} from 'react-icons/bs'; type Props = { text:…
-
-1
votes1
answer40
viewsDisable button in React via validation
Hey, good night, fellas, what’s up? I’m having trouble with the validation of a button, it should be disabled if the validation did not pass, but as I am a student yet, I can’t tell for sure where I…
-
-1
votes1
answer61
viewsUse Animation and keyframe in ui material makeStyles
I am trying to use keyframes in makestyles of the ui material, but no effects appear. The Goal is to make the button pulse. What’s wrong with my code? This is what I managed to evolve using an…
-
-1
votes1
answer18
viewsMy list of all is erased when I try to erase only a whole
This is my list of all: And this is what happens when I try to erase one whole: I tried to see what the whole returned and should return an object but instead returns it: I have this mistake too:…
reactasked 3 years, 8 months ago Inês Barata Feio Borges 313 -
-1
votes1
answer26
viewsRender radio Buttons based on arrays
I am developing an online school evaluation. I get some questions and each question has several options for selection. Need to show options like Radio Buttons, allowing user to select 1 option by…
-
-1
votes1
answer43
viewsHow to change some attributes of an object with Hooks
I want to update only some attributes of an object, these attributes are varied, one time I want to update some, another time. Follow the example: const [myObject, setMyObject] = useState({…
-
-1
votes1
answer54
viewsHow to put optional parameter in Reactjs
I need to send a request, but there is a parameter that is optional, and I must only send it on one condition. It’s like this: const [blocoSelect, setBlocoSelect] = useState("nenhum"); params: {…
-
-1
votes1
answer34
viewsHow to make React return specific components depending on the state?
I would like to know how to make React return the component depending on the state father. function One(){ return <div>1</div> } function Two(){ return <div>2</div> }…
-
-1
votes1
answer45
viewsReact Native error "Cannot read Property 'navigate' of Undefined onPress
I’m having a problem in the code I’m trying to access a screen by pressing a button, so far so good but the problem is I’m trying to pass a props to the onPress, but this mistake is happening:…
-
-1
votes1
answer37
viewsI am unable to consult API
How do I search for information within the api and display on the screen? It seems that the React does not recognize my function fetch import React, { Component } from 'react' class InputeAPI…
reactasked 3 years, 7 months ago user219338 7 -
-1
votes1
answer61
viewsDivs render but no past data appears, React
the program takes data from an api and passes through a filter that returns to the component products that should render on the screen that list, which it does but the product data is not seem.…
-
-1
votes1
answer343
viewsPercentage mask with React-input-Mask in React js with typescript
I have to create a mask for an input in the project we are already using the React-input-Mask https://github.com/sanniassin/react-input-mask#beforemaskedstatechange The solution does not necessarily…
-
-1
votes1
answer37
viewsHow to make chart responsive with Highcharts?
I am using React and Highcharts for a project and want to know how to make this chart below responsive? I tried to put maxwidth around the component, but did not succeed. I want him to take all the…