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
answer124
viewsI cannot delete warnings from Eslint
I am learning React-Native, I have never had much experience with Javascript, I have installed the Eslint extension and I am trying to follow the line looking for the best syntax. But there are two…
-
2
votes1
answer1069
viewsProblems passing props to state of the React component
Problems when passing props to component state, when in component do console.log(this) The client props is there with all the fields, the more when I do console.log(this.props) he shows me the empty…
-
2
votes1
answer3854
viewsXios basic auth - how to pass user and password to the api?
I was looking at the documentation of Xios and saw that to pass the user and password it is necessary to use: auth: { username: 'janedoe', password: 's00pers3cret' }, I applied the same to my…
-
2
votes1
answer1640
viewsPicking up parts of a JSON vector
I am doubtful about the GET function of my JS (React JS) code, I have the GET function using the Fetch api, it returns the values a certain link.json containing an array. Using this link as an…
-
2
votes1
answer4588
viewsHow to take something from an input text and pass by reference?
How do I pick up something that I typed in an input text, and when I press a "Send" button, I send that text somewhere in my code, like how we use 'this.state.algumaCoisa'... Follow the code:…
-
2
votes1
answer555
viewsError calling more than one function in onPress
I have a Button with a onPress If I put this onPress thus: onPress={() => request.manifestacaoAnonima( this.state.email, this.state.selected, this.state.manifesto, this.state.tipomanifestacao,…
-
2
votes1
answer97
viewsLoad the state value into the currency formatted DidMount component
I want to load a value defined in state of the application. Using a lib to format the input and put Real format coin mask (react-intl-currency-input). Only it does not load the value in the input…
-
2
votes1
answer191
viewsAsync/await javascript
How can I make the code below less messy with asnyc/await? class Backend { getUsers(callback){ const database = firebase.database().ref('users/') const onReceive = (data) => { callback({ data )}…
-
2
votes1
answer774
viewsError changing state checkbox in Reactjs
I’m still learning React in the state part of a component. My activity is simple: by clicking the checkbox the state of the CHECKED component should change to true and change the value of a text…
-
2
votes1
answer145
viewsIn Reactjs, is it possible to ensure that a class method is only executed after setState is completed?
I’m making a freecodecamp project using Reactjs. It consists of making two Leaderboards: one of the campers with the highest score in the last 30 days and another of those that have accumulated the…
-
2
votes1
answer372
viewsSeparate JSX from component - React Native
Is there any way in React Native to put the whole JSX in a separate file without risk of decreasing the performance of App? Type the Angular that has a file for the HTML, other to the CSS and…
-
2
votes2
answers4130
viewsRun React Native application on a Windows PC iphone
Good afternoon, I wonder if you have any way to run apps developed in React Native directly on my iPhone device but using Windows to write the codes.
-
2
votes1
answer1926
viewsHow to add a Component to each click on the React
I have a form where there is a responsible pattern (Novoresponsavel), but if there are some other have to be added a new responsible at each click of the 'add another' button, today I can only add a…
-
2
votes1
answer17
viewsHow to consume a constant in another JSX component
I have a constant: const dados = [{ id: 1, nome: 'Juliano', idade: 25, descricao: 'Front-end', }, { id: 2, nome: 'Italo', idade: 29, descricao: 'Back-end', }] I export all this constant, via: export…
-
2
votes1
answer788
viewsEnter link in URL does not load page
I have a strange problem. I’m browsing a SPA using React router v4, it’s working if vc starts the root navigation, but if vc type the address directly in the URL it gives an error. Below is the code…
reactasked 6 years, 8 months ago André Agenor 93 -
2
votes1
answer7851
viewsconsume Rest api with React and render the data in a table
my code: import React, { Component } from 'react' import axios from 'axios' import PageHeader from '../template/pageHeader' import cadastroForm from './cadastroForm' import cadastroList from…
-
2
votes0
answers128
viewsReact-createRef() Api - this.child.Current is null
In order to allow mine parent component access values of my child component (Display), I started working with the createRef() API that came out in this patch 16.3. Following the example "Adding a…
-
2
votes2
answers2901
viewsHow to take the value of select
How do I get the value of select, gave a onChange, but the value is not being returned as expected. <select className="form-control" value={area} onChange={e => setAddArea(e.target.value)}…
reactasked 5 years, 3 months ago Pedro Henrique 83 -
2
votes0
answers248
viewsHow do I set up Webpack and package.json to run the React project?
I made all the necessary Webpack settings and the project starts, but apparently it does not run the css in the project and only leaves a blank screen. Before the Webpack settings my Package.json…
-
2
votes1
answer1906
viewsPicker synchronized React Native
I have a Json with all the states and cities. I want to do when selecting the state it shows me only the cities related to the state of the selected select. My code prints the cities. with the…
-
2
votes2
answers3284
viewsChild component, return to parent REACT component
I have the following modal: <Modal dialogClassName="clientes-modal" show={this.state.show} className="modal fade"> <Modal.Header className="bg-new"> <h4 ><i className="fa…
-
2
votes1
answer987
viewsReact Router: Use more files with routes
I have a question regarding the use of React Router, I could have several files for example, main.js, stock.js and bank.js and each file have its Router ? getting something like: main.js import…
-
2
votes0
answers223
viewsHow to implement Reactjs in an Electron application?
Hello, good, I’m starting an application on Electron, but let’s say I did it in two parts, one part, the Electron, the configuration is ok, only the other part I did in other files using Reactjs,…
-
2
votes2
answers23806
viewsHow to insert image using React.js
I’m starting in React, and how do I insert an image that sits on top of my background, which is already an image? The code is as follows: import React from 'react' import Img from 'react-image'…
-
2
votes1
answer69
viewsUpdate on mongoDB is deleting the rest of the document
I have a collection structured like this: { "_id": i43h21n5lk2354, "createdAt" : ISODate("2018-08-19T16:56:31.555Z"), "services" : { "facebook" : { .... name: "Michael Jackson" .... .... } I want to…
-
2
votes1
answer11598
viewsTypeerror: items.map is not a Function
I made a request in a URL via Fetch, however it returns me an error when I ask for the mapping of the json, someone knows how to solve ? I’ve hidden the URL because it’s private. import React, {…
-
2
votes1
answer907
viewsDo I need a server to log in with React?
It may be a silly question but I’m very confused about React.js, I developed a Webapi in Asp.net core and it’s already working... I need to do a login system on React. Thinking about the way I would…
-
2
votes0
answers219
viewsDoubt about useState refactoring when implementing the SWR?
I’m starting in this world of Javascript and I have a project that I’m developing that I did the implementation of SWR in the same and with that I stopped using the useEffect and the useState of the…
-
2
votes3
answers1846
viewsAuto indentation problem when saving to Vscode
With a problem in auto-indentation of Vscode, I have tried to disable even then the problem remains. When saving a file Vscode automatically changes the indentation, follows the image before saving…
-
2
votes2
answers184
viewsHow to make a window.scrollTo(0.0) without animation
I have an React application that in certain situations (because of the React-router) I should scroll to the top of the page. The problem is that in most cases the scroll should be animated and in…
-
2
votes1
answer130
viewsThere is a standard documentation/software comments in Reactjs
I’m leading a development team on Reactjs with Node.Js, and I’m having a question about how to document or comment this code so it’s nice and easy to read by other devs. Still commenting code? Sorry…
-
2
votes0
answers103
viewsAdd Object Array Subdocument Reactjs and Mongodb
Sirs, Kindly help me with this doubt? Summary: I’m creating a mini app using Node/Mongo/React. This app uses relationship in Mongo and would like help to add data via frontend(reactjs) to the array…
-
2
votes1
answer837
viewsSetstate with onChange, Reactjs
I brought a little problem that I am going through in an application that I am doing in React, I will replicate right here below. STATE DECLARED IN COMPONENT this.state = { estadoCivil: ''}; JS…
reactasked 5 years, 8 months ago David Drums 29 -
2
votes1
answer154
viewsWeb application with React making infinite requests
export default class Usuariobox extends Component{ constructor() { super(); this.state = {lista: []}; } componentDidMount(){ this.Listar(); } Listar(){…
-
2
votes0
answers46
viewsWebpack to import css together with REACTJS
Hello, I am making a Component (REACTJS), I would like to import the css come. I’m using the css-loader and style-loader. As I had never done something like this, I do not know if the configuration…
-
2
votes0
answers48
viewsWhat precautions should I take to create a checkout page?
Hello! I am developing an e-commerce in Reactjs and doing the integration with Pagseguro and, although it is possible to use their checkout page, I would like to create mine and only send the data…
-
2
votes2
answers407
viewsHow to fire a Redux Action without a React
Hi, I’m creating a Interceptor to the Xios which, if my Answer case there is an error with the status Forbidden (403) the same need to trigger the Action that starts the user’s logoff to force him…
-
2
votes2
answers7589
viewsHow to pass parameters via url to an application in React?
I have an application in .Net MVC where I use the Session to store logged user data. But within this application I have a screen made in React which will be accessed externally (that is, it is a…
-
2
votes1
answer2373
viewsError: Module not found: Can’t resolve 'React-Redux' in
When I try to run the application through yarn returns the following error: I reinstalled the package yarn add react-redux and npm install --save redux Page code that is giving error: import React,…
-
2
votes3
answers5865
viewsHow to pass a function to another component through props?
I’m trying to do a todolist with React and at the moment I have two components: Todolistapp and Todoform. In Todolistapp I have a function that adds a value in a list that is in the state, but this…
-
2
votes1
answer64
viewsWater temperature
I’m looking to audition in React. I want to put a value on the input and will tell if the water has boiled or not, but there is no button. You’re making a mistake and I don’t know how to fix it.…
reactasked 5 years, 4 months ago Thiago Lavor 21 -
2
votes1
answer175
viewsJWT IN JAVA (SPRING BOOT)?
I’m doing a project, where I have a login. Front-end use in Reactjs, and backend in Java. But I don’t know how to make a java JWT token so that the front end can be successfully logged in. I read…
-
2
votes1
answer287
viewsAccess a list within a list in React jsx
Hello, I’m a newcomer to React and am making a request via Xios. This request returns me the following JSON: after receiving this list I make a .map on the list and it returns me the following: What…
-
2
votes1
answer106
viewsAdding multiple IDS within an array?
const [pergunta, setAddPergunta] = useState([]) async function pegarId(_id) {setAddPergunta(_id) console.log(_id)} <tbody> {getPerg.map((pe, i) => ( <tr key={i}> <th…
-
2
votes0
answers606
viewsConnection error at EXPO
Some of you, like me, must have done last Omnistack Week. I am having an error when connecting my back-end Login route in my front-end. I am using the axios for that. When I give a yarn start or…
-
2
votes1
answer565
viewsCalendar showing only month and year in React
I’m developing an app with React Turn on and I wanted the calendar to show only the month and the year. I’m trying with the dependency React-Native-calendars but was unsuccessful. import React, {…
-
2
votes1
answer87
viewsProblems with "active" Reactjs
I’m trying to create a state to set an icon like active changing its color, but I am failing miserably for having little knowledge. I created a state with the useState and I set the value true by…
-
2
votes1
answer204
viewsWhy are arrays inside an object Undefined in the request of the api using Xios?
I created an api that sends this information: { title: 'algum título', content: ['vários parágrafos'] } The method that receives the data is as follows: async componentDidMount() { let response =…
-
2
votes1
answer76
viewsDoubt about standard React class
I am starting my first steps with React, I would like to know why the class is not being created in React, when I run the command npx create-react-app creates the structure below. import React from…
-
2
votes2
answers370
viewsAlignment of same input Row using form validation
I am developing a React registration form, and for validation of input'I use the Yup. On the third Row of the form I have 3 input's, when Yup does the validation and inserts the notification…