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
-
0
votes0
answers77
viewsSessionstorage Returning NULL when starting Application
I have a function that is linked to a button, which saves a value in sessionStorage.setItem, and redirects to another page. Arquivo cliente.js pegaValorConta(id) {…
-
0
votes2
answers195
viewsMy application in React of page error not found if I type the url
Hello when I type the second url on my site Route works leading to requested page, but when I did build hospedei and repeated the same procedure the same does not work giving page not found anyone…
-
0
votes0
answers21
viewsHow to create a piece that brings data from 2 url’s via fecth api?
I have 2 API addresses below, and I need to create a React card that brings the first API photo, and the second API post. https://jsonplaceholder.typicode.com/photos/…
reactasked 6 years, 2 months ago Thiago Pereira 1 -
0
votes1
answer167
viewsSetstate does not work within component
Hello, I’m trying to give a setstate but when I run it returns me that is not a function renderInput({ input, label, type, meta: { touched, error, warning } }) { onChangeTextDestino = async (param)…
-
0
votes1
answer34
viewsFilter the month inside a extracted object with Object.Keys
I am studying React and have made a cash flow application using firebase as database. I would like to perform a query using the "map()" or another way that traversed the object showing only the…
-
0
votes1
answer971
viewsHow to pass values to another component on routes?
I have a login page, which authenticates by token and soon after, with the user and password entered are returned the user data. Soon after that I redirect the user to a component called Dashboard.…
-
0
votes1
answer176
viewsSum the values of each item equal, stored in one object and store in another array
I am making an application using firebase and reactjs, which returns an object with the output stream(outflow). As I am using chartjs to display a chart, I need to generate an array where each…
-
0
votes1
answer60
viewsHow to use function parameter as object attribute?
Hello! In order to reuse a function I am performing the following procedure: View 1 has this obj: obj: [ {"fruta": "maça", "valor1":1}, {"fruta": "banana", "valor1":1}, {"fruta": "pera", "valor1":1}…
-
0
votes1
answer462
viewsHow to disable React Navigation Drawer on specific routes
Hello, I’m creating an application that should not display Drawer on specific routes like login, registration, etc. Currently my file is like this: import React from 'react' import { FluidNavigator…
-
0
votes0
answers20
viewsGuys, I’m using an overflow on a component here, but it doesn’t show all the content, it gets cut into one part. Could you help me?
`export const Optionbar = Styled.div' width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 0 15%; font-size: 1.6rem; transition: all 0.4s; align-items: flex-end;…
-
0
votes0
answers170
viewsBug when rendering in production Nextjs fonts
Talk people! I’m creating a static website with Nextjs and Styled-Components. Everything happens well in the development environment, but when putting into production imports of sources do not work.…
-
0
votes2
answers201
viewsCameraroll React-Native
I need to create a script that returns and list the images found in the user’s mobile gallery. For this, I am using the getPhotos method of the React-Native Cameraroll component…
-
0
votes1
answer785
viewsAdd +1 min to countdown timer - With timer already finished or in progress
Each time I click a button, I want to add +1 min to the timer. <Button onPress={this.somarUmMinuto} title="Somar 1 minuto" color="#007FFF" accessibilityLabel="Somar 1 minuto" /> Code used to…
-
0
votes2
answers925
viewsHow to change the color of a text according to the state of the object?
How could I change the color of the text according to the state of the object, for example: const pagamento = [ { id: '1', title: '30/05/2020', state: true }, { id: '2', title: '30/06/2040', state:…
-
0
votes1
answer526
viewsReact Route without link
I am starting my studies with React and I am using React Router to navigate between pages by clicking on links in the menu, but I have a question, how do I access a page without a link ? How do I…
-
0
votes2
answers3687
viewsCatch state of child component in React
How do I catch a state of a child component? In my example I have Shell.js which is the parent component: class Shell extends Component { render() { return ( <div> <Nav propsdaNav={1} />…
-
0
votes1
answer32
viewsVisual Correction Studio
How to fix this formatting? Example, visual use Studio and everything I’m writing is being separated this way: function Menu() { return ( < header > Revista < /header> ); } No way…
-
0
votes1
answer2028
viewsHow to prevent an React Native application from returning by clicking on the Backbutton using React Navigation
Hello, I am creating an application in React Native, and for the browsing I have been working with the plugin React Navigation. The structure of my project is like this: import React from 'react';…
react react-native react-navigation react-navigation-fluid-transitionsasked 6 years ago LeandroLuk 4,989 -
0
votes1
answer480
viewsAsp.Net Core Webapi Returning Object List
I am trying to return a list of a "Plan" Template that has a list of "Expenses", returning only the plan list works, but when added to return the spending list of a javascript error. "Failed to load…
-
0
votes1
answer78
viewsHow to work with asynchrony using Reactjs
I have the following code: requireUsers = () => { this.users = database.ref('users') this.users.on('value', snapshot => { this.state.users = snapshot.val()…
-
0
votes1
answer603
viewsHow to get the status of a React within a React Native
Hello, I’m new to React Native and I’m having problems to pass the status of a Reducer to a component I made. the same is as follows: import React from 'react' import { connect } from 'react-redux'…
-
0
votes2
answers224
viewsMy state react, doesn’t it work?
Man state does not work for nothing, I have read in the documentation, I did the same as you should notice I am new in the react, example of my code: export default class Cursos extends Component{…
-
0
votes1
answer36
viewsHierarchy of requests with Await
Next... I need to make a hierarchy of requests that depend on each other. I did the whole structure, but when I run the code they are solved asynchronously, without waiting for the resolution of a…
-
0
votes0
answers550
viewsRun a function and if it takes longer than x seconds of error - React Native
Good afternoon! I made a function that searches the data of a JSON on the Web, but I wanted to involve it in a function that took longer that for example 10 seconds exploded an error on the screen,…
-
0
votes1
answer405
viewsHow to use Material Icons with next.js?
import Link from 'next/link'; import MaterialIcon from 'material-icons-react'; const Header = (props) => { return ( <nav> <ul> {navOptions.map(nav => ( <li> <Link…
-
0
votes1
answer41
viewsReact: npx create-React-app vs referencing . js
What a difference when working with React, using the command npx create-react-app APP when simply creating a file html and reference libraries via script (.js)…
-
0
votes1
answer33
viewsIs it possible to send JSX tags from Nodejs(backend) to Reactjs?
I need to send a data to the frontend, but I need it to be already with determinate tag around it, for example... given backend: Name: Gabriel I need you to get to the front this way:…
-
0
votes1
answer272
viewshow to make React render a table
I’m trying to make a table , 5 tall by 7 wide , inside the React , however, when I tried to run the 2° for loop he does not recognize and ends up not doing the action , obg by help S2 function…
-
0
votes1
answer53
viewsHow to access an object within an object, where its name is a number?
Follow an example of the object in question : obj : { "bairro" : "Centro", "dAula" : { "Quarta" : true, "Segunda" : true }, "dVencimento" : "10", "dataCadastro" : "10/10/2017", "dataInicioContrato"…
-
0
votes1
answer104
viewsLogin React Native + Firebase error using "Switchnavigator"
Error (Undefined is not a Function (near '...(0, _reactNavigation.Switchnavigator)...')) when compiling application. I need that when logging in is directed to the screen "Main". import React from…
-
0
votes2
answers2621
viewsRedirect to "Home" screen after login validation - React Native + Firebase
I need to implement in the code below the command so that the user is validated is redirected to the screen "Home". The changes I’ve made haven’t solved my problem. I can create the user, save in…
javascript react react-native react-router react-navigationasked 5 years, 11 months ago Philipe Said 138 -
0
votes2
answers489
viewsProblem with parole in React
I’m trying to make a condition where the active component depends on a state variable. this.state = { display: 0, } The state 0 is the initial state, which is changed when the user clicks a button.…
-
0
votes3
answers125
viewsCheck whether an item exists within an array, using a variable
Let’s say I have this array: let checkOne = [ { "id": 273, "attributes": { "humidity": { "qty": 74.3223333333333, "unit": "percents" }, "protein": { "qty": 23.525, "unit": "g" }, "lipid": { "qty":…
-
0
votes1
answer54
viewsInvert boolean variable React.js
onUpdateItem = i => { this.setState(state => { const subtarefa = state.subtarefa.map((item, j) => { if (j === i) { item.status = !item.status return item; } else { return item; } }); return…
-
0
votes0
answers48
viewsReact and Web API - How to submit form with files
I’m using React for front development and c# Web API for back. I am trying to submit a form that has an input file, in the API I created a Viewmodel to receive this data. Before submitting, I place…
-
0
votes1
answer165
viewsHow to create components from another base component
The idea is to create a component for each type of input, for example, InputPassword for <input type="password">, however, in order to reuse code, most of these components have an equal basis,…
-
0
votes1
answer401
viewsonChange on React not working!
This function is giving error saying that the event is null event: handleChange(event) { this.setState(prevState => ({ equipe: { ...prevState.equipe, nome: event.target.value } })) } input:…
reactasked 4 years, 1 month ago Natã Lopes 25 -
0
votes1
answer62
viewsImage does not render
I’m taking any image in a folder at the root of the project and the image doesn’t render... There’s that image icon with the alt. I’ve looked at several topics and sites, I do everything exactly the…
-
0
votes1
answer87
viewsHow to change a state in the following scenario with the Onchange event
I have a component and the following state: this.state = { form : { name : '', username: '', email: '', phone: '', address: { street: '', suite: '', city: '', zipcode: '' } } } In form fields, use…
-
0
votes0
answers229
viewsOpen a modal of another POO React class
I’m learning Javascript and POO so I may be doing something stupid, I’m trying to make a navbar and this navbar open different functions of different classes in other files. That part where you have…
-
0
votes1
answer80
viewsError while logging in with React using Fetch
I am building a software that has a Node API and a client in React. The backend is configured and working. You are logging in and when logged in bring back the data you need. However, with my React…
-
0
votes1
answer51
viewsREACT Condition for NULL value in Input
I have a question on React when doing a data update for a student where I use the useEffect() to retrieve the student’s data and take them to the form by placeholder={} and then I have a onChange…
-
0
votes0
answers31
viewsIs it mandatory to set a state for all events?
Well, my doubt may be a little unethical, but either way, it’s something I’m curious about. Am I required to set a state for all events on the screen? Let me try to explain... I have a list of users…
reactasked 4 years ago Luiz Utzig 19 -
0
votes0
answers41
viewsNested components and error rotation
Guys are developing a system in React that will consume a Rest api in Django. For development I am using the React, React-router-dom, mdbreact. I was making a form to create user account and when I…
-
0
votes2
answers3405
viewsWhat does this error mean? (Assign Arrow Function to a variable before exporting as module default import/no-Anonymous-default-export)
Assign Arrow Function to a variable before exporting as module default import/no-Anonymous-default-export export default () => <header className="header"> <img src="" alt="" />…
-
0
votes2
answers44
viewsGrab list of objects within the array
I’m having some difficulty to get the values that are of my function and pass them to a list, follow the code: const [listaPais, setListaPais] = useState<{ id: number; name: string }[]>( [] );…
-
0
votes1
answer34
viewsShare code (React or Vue) between more than one project
Let’s say that I have the web application in React or Vue. Part of the code I will reuse to several clients, about 70%. The other 30% would be layout changes and some extra COMPONENT that each…
-
0
votes2
answers166
viewsWhat defines the name of Arrow Function in React
I’m studying Reactjs, and in the course I’m doing the teacher varies between class and arrow function, my doubt is, where the name of Function comes from? Example: When we create a component in…
-
0
votes1
answer796
viewsEslint error: "Must use destructuring state assignment"
Could someone please let me know what I’m doing wrong? The mistake "Must use destructuring state assignment" is in the {this.state.time}. import React from 'react'; class App extends React.Component…
-
0
votes0
answers318
viewsChanging Width of the Component Drawer material-ui React
I am learning both Re-act and using the material-ui in conjunction with React, my problem is that I would like to use a "custom width" for the component Drawer, in my initial attempt I did the…
reactasked 5 years, 10 months ago Leonardo da Silva 67