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
votes0
answers228
viewsRun Redux Saga on startup
I created an offline app first to perform offline actions and send when online, and it works fine, but when the app closes and restarts the action queue does not perform because whoever checks the…
-
1
votes0
answers161
viewsHow to create a Dynamic Theme with good practice for my Component?
I need to create a dynamic theme for a particular component or several others, where techniques of clean code and good practice concerning structuring of directories, file separation by types among…
-
1
votes1
answer217
viewsHow to keep setState using Router in React?
I’m starting my studies with React and needed a help: I have an application that shows a list of "solutions". It also has a button that goes to a new page (which I programmed via Router) able to add…
-
1
votes0
answers375
viewsTypeerror: Cannot read Property 'map' of Undefined
Hello, I’m starting with Act. I have the following structure import React, { Component } from "react"; class Dezena extends Component { render() { return ( <td className={ this.props.foiSorteada…
-
1
votes1
answer128
viewsResume the number address suggestions with google Places Api
I’m using the Google Api for the address search. The api works correctly, but I need the api to return me the data already with the location number. Currently the api returns me something like: Av.…
-
1
votes1
answer1821
viewsThe data property does not exist in type 'Intrinsicattributes & Intrinsicclassattributes & Readonly & Readonly<{ Children?: Reactnode; }>'. ts(2322)
Português: The type '{ data: Undefined; }' cannot be assigned to the type 'Intrinsicattributes & Intrinsicclassattributes & Readonly & Readonly<{ Children?: Reactnode; }>'. A…
-
1
votes1
answer147
viewsCreating a CSS card
Well, I’m trying to turn a table into cards when the site opens on a mobile device, but I don’t know much about CSS. I’m basing myself on this model, in my card turned only the data, but the header…
-
1
votes1
answer242
viewsREACT - Datepicker error
Good morning! I’m trying to use datepicker components in React. I’m using materialize, but even the component of it is generating the same error. I am currently trying to use the…
-
1
votes2
answers669
viewsHow to change parent element attribute from within child
I want to click on mine Icon it changes properties of the first element. Where am I missing? How to do? import React from 'react'; import './header.css'; import { Col, Container, Row, MediaBox, Icon…
-
1
votes0
answers64
viewsChange widget height in horizontal scrollview
How do I make a horizontal Scrollview resize the height based on the active card? The problem occurs when a list is 600px high (for example) and another list is 300px high. The expected height of…
-
1
votes1
answer439
viewsCreate generic modal in React Native
I’m trying to create a Modal component that can be reused in other parts of the application. However I am not managing to carry out the opening control of the same. Follow my attempt: Modal export…
-
1
votes2
answers117
viewsHow to add an array within an array?
I’m creating a Reactjs application that hits the Github API and brings the user and the repositories. But I wanted to bring the commits from every repository and I’m not getting. My code is this:…
-
1
votes1
answer768
viewsConditional formatting of Regex phone number
Context: have a input that as I type a function is called to check if the phone number is in the correct format. This function must accept numbers in the formats: (XX)XXXXX-XXXX and (XX)XXXX-XXXX,…
-
1
votes1
answer47
viewsHow do I know whether or not to update a component?
I’m using the React, React Native and Redux to make an app. I tried to study a little about the life cycles of a component but ended up getting confused about the various options present when…
-
1
votes1
answer397
viewsChanging text depending on the value returned from the Reactjs table api
I created a table using the Reacttable component and am feeding it data from an api. One of these data returns as 0 or -1 and I want to treat them so that if it comes 0 it appears "Enabled" in the…
reactasked 5 years, 3 months ago Gabriel Midão 85 -
1
votes2
answers430
views"Value Below was evaluated just now" - React (Vibrantjs)
Hello, everyone. I’m using the library Vibrantjs passing an array of images and saving the return in the state of my component in React. As in the code snippet below. gerarPaleta = () => { let…
-
1
votes1
answer500
viewsCrud ID with javascript
import api from '../../services/api' export default function Area() { const [ area, setArea ] = useState([]) useEffect(() => { async function loadArea() { const response = await api.get('/area')…
-
1
votes1
answer174
viewsReact, Redux, Mobx] What is the best way to manage status with paging?
I use mobx, and now also Hooks, to manage application status (if using Redux would face the same problem), and couldn’t find a better way to manage paginated listings. If I have a list in the global…
-
1
votes1
answer28
viewsQuestion about class integration in React Javascript components
I’m having difficulty interacting a class with a component using React. To create a constructor, where the new "classe" would be inserted into my React Dom component. Simple example below: there is…
-
1
votes0
answers118
viewsReact + React Router + Laravel => error while performing refresh or insert url manually in browser
I’m using React for the front of an application in Windows. In React, through the React-router I am accessing components dynamically through the parameters passed via url by the router link. If you…
-
1
votes2
answers2220
viewsMap a json to React
Hello, I’m studying React JS trying to make an application with the API of the CEP. However, I saw that the JSON of it is an object and does not have an array, therefore, I am not able to perform…
reactasked 5 years, 2 months ago Thales Maia 320 -
1
votes1
answer466
viewsI can’t center the title
Using React-Native and React-navigation, for some reason nothing I tried worked to centralize the title. Attempts: Alignself export default class First extends React.Component { static…
-
1
votes2
answers208
viewsValue Textarea does not work React
Hello, I am trying to "popular" a textarea with a value, but when I try to edit the field and it does not allow. I tried using the property "defaultValue" but the field is empty. It follows parts of…
-
1
votes1
answer2407
viewsWarning: componentWillReceiveProps has been renamed
I have updated my React project from version 0.57.8 to the latest version and am receiving the following warning message: Warning: componentWillMount has been renamed, and is not recommended for…
-
1
votes1
answer104
viewsNodejs / Reactjs: Manipulating Token
I’d like your help. I have an API with Nodejs that performs user authentication (POST method), generating a Token (jwt) and returning the same: module.exports = { async authenticate(req, res) {…
-
1
votes2
answers2305
viewsReact.js creating several components with arrays
I’m trying to create several components <Pit /> however, one per result coming from the API, without excluding the previously created. The API returns an object with 2 arrays inside, the…
-
1
votes2
answers96
views[[Promissevalue]] React
I’m doing a get an api on Nodejs, only the result is coming back within a [[Promisevalue]], how do I access it directly? With async and await it works, but when for it to authenticate on the route…
-
1
votes1
answer69
viewsHow to manipulate an empty filter?
I need a logic that displays a <Text> saying that there are no items when the produtosArr.filter() is empty (or when the filter does not return anything to me).…
-
1
votes1
answer248
viewsonClick by Innerhtml React?
I’m trying to create a img with the Event of onClick in the React but it’s printing the code that way on the Web. My Internet code is like this: coluna4.innerHTML = `<img onClick={() =>…
-
1
votes1
answer501
viewsProblem with infinite loop component in React
I have my header component, where I search the user information through the api, the problem is that this search gets stuck in a loop that keeps searching the user non-stop. code:: import React, {…
-
1
votes1
answer3537
viewsHow to make a search system with React
I would like to know how to create a search system inside the React having an input and another search button, preferably using React-router if you have how to do it. In particular I’m trying to use…
-
1
votes1
answer508
viewsGradle error in an React application
I am creating an application for study with React Native and this error appeared below. Does anyone know how to solve? I’m starting now with React and React Native and I have no idea how to fix it…
-
1
votes1
answer1924
viewsRequest is presenting Cross-Origin Request Blocked in Reactjs app
I am developing an application in React and previously created a restful API with Node and express, in my api I added the module Cors const cors = require('cors'); and added it at the boot of the…
-
1
votes1
answer830
viewsTypeerror: pokemonList.map is not a Function
Good afternoon. I have the following code snippet: import React,{Component} from 'react'; import './App.css'; class App extends Component { constructor(){ super(); this.state={ pokemonList : [] } }…
reactasked 5 years ago victorgvargas 33 -
1
votes1
answer377
viewsSend jwt in header by GET
Hello I would like to know how I could send a jwt in my header to consume in my API, a route get to catch users ( need auth ) my api to catch users: app.route('/users') .all(app.auth.authenticate())…
-
1
votes1
answer860
viewsreactjs - Maximum update Depth exceeded
I am creating a dynamic table, in which I save the row information in the localStorage. To render the table, I give a getItem in localStorage, a setRows on a map in the variable rows. const [rows,…
-
1
votes1
answer185
viewsDisplay array of "children" according to array of "parents" (JS)
Assuming I have the following JSON, and want to turn this information into HTML components (in my case, I’m using React), what should I do? [ { "id": 1, "nome": "Pai1", "filhos": [ { "id": 1,…
-
1
votes0
answers18
viewsReactjs add values from my websocket to components
Hello I’m starting to study Act and I find myself in a doubt: good I have a page with the following structure: import React from 'react'; export default function Home(){ return ( <> <h1…
-
1
votes1
answer2673
viewsReact Hooks useEffect even with empty dependency runs more than once
I am using the React hook useEffect to fetch the data in an API, when the page loads, useEffect runs 2 times, but should run only once, since I declared the second parameter (dependency array) as…
-
1
votes3
answers1289
viewsError when launching Reset
When I try to launch the React after creating-React-app and having already created the folder this error appears Could not find a required file. Name: index.html Searched in: C:\Users\LUIS…
-
1
votes0
answers35
viewsHow to manage the state of a variable without calling the API
With the reducer: import { HIDE_MENU, ESTADO_MENU } from '../actions/types'; const initialState = { open: true } export default function (state = initialState, action) { switch (action.type) { case…
-
1
votes1
answer4310
viewsHow to use custom fonts in React?
I’m getting the following error: TypeError:name.includes is not a function This error occurs when I add the following code snippet: fontFamily: fonts.regular App.js const fontConfig = { default: {…
-
1
votes1
answer1381
viewsHow to access properties of an object within another object in Reactjs
I am consuming via Xios the following JSON: https://randomuser.me/api/? Results=5 When I try to access person.name.title I get the following error: I can only access the title property when I type…
-
1
votes2
answers403
viewsHow to return the years array using React-select
I’m using the react-select to select the React project. I need to return the last five years. And then popular the options={} select. Only that he is only taking the last year, in the case 2020, but…
-
1
votes0
answers224
viewsReact: Uncaught (in Promise) Typeerror: Dispatch is not a Function
Hello, For some reason I make a call and I get the desired return, but it gives an error of Dispatch, I’ve tried several things and nothing works. My action: export const formulariosExternos =…
-
1
votes2
answers1017
viewsImage upload React Axios and PHP
I need to make a posting system that includes image and post data with Reactjs, Axios and PHP(yes, php). No Reactjs const post = async (formData) => { const image = new FormData()…
-
1
votes1
answer428
viewsTypescript error when rendering a component that returns array in React
I’m creating an React app with Typescript that searches the Github API. I’m having trouble passing one array as props to another component. The logic would be: User has Repos (array of Github…
-
1
votes1
answer718
viewsuseEffect not updating states in the first iteration
I’m using the useEffect to get the data from a table. The problem is that even if I receive the data from the api, the states are not updated in the first iteration, so I have to do two get in the…
-
1
votes1
answer92
viewsProperty coming as Undefined?
When I try to access the full_name property of the user object with useState, the application says that the property is Undefined. Here is the code: import React, { useState, useEffect } from…
-
1
votes2
answers1049
viewsinnerHTML at React
Good morning. I’m getting a reply received by a API in my application React, however, such a response is a array containing string’s with elements html: 0 "<p>This Emmy winning series is a…
reactasked 4 years, 9 months ago Thales Maia 320