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
-
-2
votes1
answer78
viewsError accessing property with map function
When I try to access the property this.props.arrayMenu shows me the following error: Uncaught Typeerror: Cannot read Property 'id' of Undefined. as shown below: import React , { Component } from…
-
-2
votes1
answer367
viewsError in map: this.state.filmes.map is not a Function. I’m not being able to access the Results information. Could you help me?
import React, { Component, Fragment } from 'react'; import $ from 'jquery'; export class ListaFilmes extends Component{ constructor() { super(); this.state = { filmes: [], } } componentDidMount() {…
-
-2
votes1
answer888
viewsError trying to post on Mongodb with Insomnia
Hello, I am trying to insert a data in the database (Mongodb)using the POST type, I am using Insomnia to perform the inserts tests but when I try I get a return of errors by the nodejs terminal, as…
-
-2
votes1
answer58
viewsAPI get/put error
Hello, everybody! I am studying nodejs and React. I built a little project that performs a crud with Mysql database. The project is to show and edit employees(employees) of a company. I can register…
-
-2
votes2
answers49
viewsSearch by full name - Reactjs
Hello, I’m trying to create a Search Component and when I search for example full name it return me the full name, but it only returns me the name example: [I type] Victor - He returns Victor, but…
-
-2
votes2
answers77
viewsRemove span added with checkbox
I have input in html <input value ="Get" onClick={GetSelected} type="checkbox" value="SLA contratual" /> when clicked a span is added to a list <li id="teste"></li> I need to…
-
-2
votes1
answer107
viewsReact and Redux - update status with button
I have a button on my app that opens a Modal. I’m implementing Redux in the application, and now I’m not knowing how to make the button work again. I’m using a fixed state while still learning to…
-
-2
votes1
answer982
viewsPaging of a large array in reactJS
I’m pulling an array with a size of about 20,000. However, at paging time, all available pages appear in my paging field. But I wanted to narrow it down, so that only three numbers and like, 1 2 3…
-
-2
votes1
answer888
viewsPage with Reactjs consuming from an API
Yesterday I was having a problem in being able to create a page with nodejs for my API and with help from the community got me a north and I managed to solve that situation. What’s the idea? There…
-
-2
votes1
answer420
viewsError 404 in POST with NODE and REACT
I am building an application with nodejs in the back end and React in Frond-end. I made a registration function but I can not perform the POST, returning: xhr.js:178 POST http://localhost:3333/users…
-
-2
votes2
answers158
viewsHow to receive a function in the onClick of a component
I’m trying some ways but it doesn’t work, I put a string in the console.log to confirm. but will not, this is the component with a button, I tried to call with onClick but it did not work class…
reactasked 4 years, 7 months ago DVD de Vinil 21 -
-2
votes1
answer44
viewsThere is something wrong with creating an React project
When trying to create a new React project the action is not completed. I will attach prints with errors and versions. I have tested many commands I saw on the internet, but none solved my problem. I…
-
-2
votes1
answer420
viewsClear field after Submit with Redux and Redux-form
Talk, guys, after catching a lot and having nowhere else to go, I came to ask for your help. My scenario is I’m with a form where the fields are the Fields of the Redux-Forms. I need, after Submit,…
-
-2
votes1
answer1522
viewshow to style an icon inside input in React-Native
import React from 'react'; import { View, Image } from 'react-native'; //import { useNavigation }from '@react-navigation/native' import { Octicons, Fontisto } from '@expo/vector-icons' import…
-
-2
votes1
answer827
viewsTypeerror: Trips.map is not a Function
I am having trouble reading a JSON with React.js. I get the following error: TypeError: trips.map is not a function src>pages>Home>index.js import React, { useState, useEffect } from…
-
-2
votes2
answers380
viewsThe set function of the state of the React is not actually receiving and passing on the values
I don’t know pq, but when I try to make a request for my backend, the state of "posts" does not receive the value of Answer.data. That is, the two "console.log" have different values, while…
-
-2
votes2
answers107
viewsError in searching collection points
Last week I followed Next Level Week, which brought the idea of creating a system for Mobile and Web, the web part I was able to do, all according to the video. but I have a problem so far in the…
-
-2
votes3
answers130
viewsTable with data array
Why the table only appears data if you set the position of the element in the array? import React from 'react' import Head from 'next/head' import { Table } from 'reactstrap' import axios from…
-
-2
votes1
answer23
viewsLive search using React-Redux
Hello, I’m trying to create a live search with Redux, but it only gives the match with the full word. What is the best method to actually return to my table, in this case only the values that the…
-
-2
votes1
answer170
viewscannot GET // React
We created our first project in React, local everything works normal.. When we host on the web ... the system enters the address for example https://www.dominio.com/painel_teste At that moment…
-
-2
votes2
answers708
viewsHow can I catch error 401 when making a post using Reactjs Xios on a login screen?
I’m making a login screen, I have a function that posts an API sending user and password, and gets a token back from being correct (so far so good), or returns error 401, which is shown in the…
-
-2
votes1
answer183
viewsProblems to render on screen in React Native
I’m having trouble putting on the screen a simple "main page" what’s wrong with the code? (no error appears in the console) main.js file import React, { Component } from 'react' import { View, Text…
-
-2
votes2
answers1463
viewscreate dynamic select with Reactjs + Hooks
Hello. I am trying to create a form with four selects (Animal, Size, State and City) the state and city selects that are being a problem. One makes a request to present the Brazilian states (is…
-
-2
votes1
answer32
viewsWith regard to React
I have a question about react, i wanted to change the content of the page by clicking, but the site recognizes only as Object. Function import React from 'react'; //funções export function botao2(){…
-
-2
votes1
answer49
viewsDifficulty with Asymchronism - Javascript/Reactjs/Google Maps/Distance Matrix API
Good afternoon, everyone, I’m new in the area and I’m having difficulty developing a code that runs Function2 only after the return of Function1. How can I adjust the code for Function2 to run only…
-
-2
votes2
answers43
viewsPassing specific attributes to a component in React
Hello, I have a question about how to use attributes in a component created in React. Imagine that I created the following component: const AnimatedInput = ({ label, type }) => { return ( <div…
-
-2
votes1
answer122
viewsUnhandled Rejection (Typeerror): this.setState.list is Undefined
I’m doing a project of the kind CRUD with the React and in compiling it appeared: "Unhandled Rejection (TypeError): this.setState.list is undefined" export default class UserCrud extends Component {…
-
-2
votes1
answer136
viewsAdd values from a json api and display results // React JS
My json api: { "chamado": [ { "id": 1, "numeroChamado": 435689, "sistema": "xx", "requerenteChamado": "xxx.xxx", "tecnicoChamado": "xxx.xxx", "statusChamado": "Processando", "valorBoleto": 350,…
-
-2
votes1
answer43
viewsShow array first element that may not have been loaded using React
I am developing a quiz application using React for study purposes. I have the state called Quiz, the same consists of: interface QuestionData { id: number; question: string; explanation: string;…
-
-2
votes1
answer88
viewsconst returns Undefined when using the getServerSideProps method of Next.js
Hello, I am using React with Next.js and using the native Next.js method, getServerSideProps to retrieve browser cookies. It turns out that the breakdown works for the first const, but not for the…
-
-2
votes1
answer321
viewsTypeerror: Cannot read Property 'name' of Undefined **REACT
I cannot access the values of the object Movies. When giving a console.log to the bla variable, the information I need appears, but when rendering, I cannot access the values . import React, {…
reactasked 3 years, 8 months ago Amanda Conde 1 -
-2
votes1
answer25
viewsHow do I return my modal to the screen? I’m using Reactjs
I have a button that changes the visibility of my modal and puts as true, after that the intention was to show the modal on screen as if it was an Alert. const Cadastro = () => { let history =…
reactasked 3 years, 6 months ago Lucas Lyra 3 -
-2
votes1
answer32
viewsbutton event in React.JS
i want to add the chart to the panel when I click the access button, as I make it appear inside the panel I stylized without putting it right there, only after clicking the accessos button??? import…
-
-2
votes1
answer26
viewsHow to render an asynchronous function in reactJS?
My problem is this: I have an asynchronous function that makes a mysql request and, depending on the result of the request, returns a different DIV. const GetData = async(idAluno,disciplina) => {…
-
-2
votes1
answer44
viewsDelay or not sending the data to the back-end, what to do?
I have a ready front-end of a registration form, but they are working as follows: I do all the registration and when clicking on the button it calls the function that takes the values of the fields…
-
-2
votes2
answers192
viewsHow to pick specific field of an object array using the material ui autocomplete component
I have a Material UI autocomplete component, created using the package formik-material-ui. The component renders an array of model objects below: const teams = [ {id: 1, name: 'Barcelona'}, {id: 2,…
-
-2
votes1
answer23
viewsHow do I pass a parameter to an external function from within the STYLED-COMPONENTS using Reactjs with Typescript?
PS. The idea here is not to use the parameter directly in Styled: opacity: ${(props) => props.myArr[0].myOpacity)} . The idea would be: Pass a parameter (myArray) of any component for a…
-
-2
votes0
answers14
viewsSpecified route configuration error using Fuse React Maximum update Depth exceeded:
I am using the Fuse template for React and need to configure private routes for each specific user profile, following the documentation I set my route file by placing the path parameter and the…
-
-2
votes0
answers19
viewsReact JS - Why are my components within a MAP function not updating with useState?
React JS - Why my components within a MAP function are not updating with useState? I’m in the following situation: I receive a contact ARRAY from my API and use the MAP function to return contacts…
-
-2
votes0
answers21
viewsHave a screen with folding folds on tabs in Reset so when I change the previous tab reset
This is my code from the General Data tab import { Field, Form, Formik } from "formik"; import React, { useState } from "react"; import { SearchCep } from…
-
-2
votes0
answers14
viewsHow to return Boolean from a Promise<Boolean> in React.js?
I have this checkRouteAuthentication function() async function checkRouteAuthentication() { const body = { token: localStorage.getItem("token") } const resp = await…
-
-2
votes0
answers16
viewsError 404 when running npm start, but I am giving the command inside the project folder
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport"…
-
-2
votes0
answers27
viewsHow to create an interface or generic type for an object where all its properties are functions with different arguments in Typescript?
Let’s say I have these objects: const actionsPost = { likePost: (id: number) => dispatch({type: Actions.like, payload: {id}}), addPost: (title: string, body: string) => dispatch({type:…
-
-2
votes0
answers12
viewsUsing Muidatatable
I made some videos on youtube lessons that earned me a small application for the company, I put a small schedule and a form of vehicle entries to run here at the company where I work, so that’s…
reactasked 3 years, 2 months ago Ruberval F. Lucas 1 -
-2
votes0
answers19
viewsBy clicking on the right or left arrow, change the month and the dates of this month with Reactjs
I need that by clicking the arrows on both the right and the left, it changes the name of the month and consequently the days of those month. Example: click on the right arrow, change from "January"…
-
-2
votes0
answers23
viewsAsync/await not working in React typescript (Hooks)
I’m running a route-fed authentication. But this not respecting the await of the post in the login api. Sometimes it works locally but most of the time it "skips" the post. import React, {useState}…
-
-2
votes0
answers10
viewsREACT PERCENTAGE CALCULATION
Good afternoon, I’m new here. I’m racking my brain to find out how I’m going to be able to do a percentage calculation on the calculator I’m creating, I can’t make it happen. The other operations…
-
-3
votes1
answer2785
viewsError executing Yarn start/ npm start command
As soon as I run the create-React-app command and create the project. at the end when I run the "Yarn start" command. follows the following error: yarn run v1.22.4 warning package.json: No license…
-
-3
votes1
answer145
viewsCountdown does not stop at Zero
Countdown timer doesn’t stop when it reaches "0". I need the timer to stop when it reaches "0" and when clicking on the "start" button it starts with the set value, which is "1 min" and decreases to…
-
-3
votes1
answer253
viewsHow do I display this image on my React site?
I created a Rest API to return an image of my Amazon S3 Bucket. but the image came in a strange format and I can’t see it on my page. The strange thing is that when I perform a get on Postman the…