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
answer66
viewsWebpack Reactjs
I am facing problems with my webpack, I get in the terminal this following error: you may need an appropriate Loader to Handle this file type webpack.config.js: var path = require('path'); var…
-
1
votes1
answer1367
viewsInstallation of dependencies on npm start but not finish
I’m taking a course and accompanying a book of Nodejs. In the book I am asked to install the *Express and Babel, already in the course ask to install dependencies of an application that they make…
-
1
votes1
answer351
viewsIs there any way to block the rendering of a particular component in React?
I need to block the rendering of a certain type of component, for example: <td>{props.children}</td> I need to capture the component that can be passed to Children and block its…
-
1
votes1
answer671
viewsError when compiling REACT
I am getting the following error on my terminal when trying to compile React ./src/pages/main/index.js Line 3: 'api' is defined but never used no-unused-var Follows the code: import axios from…
-
1
votes1
answer54
viewsCalling Controller method and get the function print
When I call the Controller Method to list users, instead of returning me the array it returns me the print of the function Controller code: export default userController = { Listar: () => {…
-
1
votes1
answer6658
viewsReact - How to modify a state of the parent component from the child?
Let’s say I have a parent component: import React from 'react'; import style from './style.less'; export default class Wrapper extends Component { this.state = { active: false } render() { return (…
-
1
votes2
answers2357
viewsHow to call two functions in onClick (Reactjs)?
Here are my two functions, chamaLogin = () => { this.setState({ redirect: true }); }; ----------------------------------------------------------------------------- handleSubmit = event => {…
-
1
votes1
answer66
viewsHow do code to look an if just after you have changed the prop of an object?
I have a form that when I click send leaves red the field that is empty. It makes different validations in each of the fields. Only when all fields are gray border it sends the data via post and…
-
1
votes1
answer620
viewsCreate button effect pressed
I have the following component in React: import React, { Component } from 'react'; class Counter extends Component { constructor(props) { super(props); this.state = { count:…
-
1
votes1
answer2746
viewsHow to concatenate values within a class in React.JS
I have the following code: { this.state.listSkills.map(function(habilidade){ return ( <ul className="habilidades"> <li className="habilidade-"{habilidade.value}>…
-
1
votes1
answer334
viewsWhy use Stylesheet.create?
Why use the StyleSheet.create? When starting a new project (react-native init test, the project comes with the style as follows. const styles = StyleSheet.create({ container: { }, welcome: {…
-
1
votes3
answers6521
viewsCan you map() an object array to React?
I’m doing a project where I need several recipe cards that will contain: title and ingredients. These cards must be expandable (The user will see the title and when clicking, the ingredients will be…
-
1
votes1
answer579
viewsWhy use Redux to request the API in React?
I started to see React well before learning how to use Redux and always requested in the API using a Fetch or Axios in the component itself. Today I already venture into the world of Redux and come…
-
1
votes0
answers48
viewsLibrary to create drawings with images dynamically for Reactjs?
Hello. Does anyone know a graphic or drawing library for Reactjs that can do something like this? I need a graphical library that makes it possible to create geometric shapes or insert images in…
reactasked 5 years, 6 months ago Vinícius Fernandes 11 -
1
votes0
answers98
viewsI cannot increase the width of my input
I cannot increase the width of this input. I use bootstrap and css. In my code, there is no such input tag... <div className="form-group col-sm-12 col-lg-8"> {employees.length > 0…
-
1
votes2
answers51
viewsProperty . map cannot access the object correctly
I’m getting information from an object when accessing at certain points, but one in particular is not accessible, situation: When I access the.title item it correctly returns the title value, but…
-
1
votes2
answers652
viewsDocker with React, refresh the updates without having to upload the container again
I created an application in React and decided to run it with Docker locally, only for development At Dockerfile it was like this: FROM node:8 WORKDIR /usr/src/app COPY package*.json ./ RUN npm…
-
1
votes1
answer2053
viewsPicking up input number text in Reactjs
Hello, I need to pick up the typed text within two input’s number at the moment I click the generate serial button I have the following structure import React, { Component } from 'react'; import {…
-
1
votes1
answer65
viewsProblem when startar React project
Guys I cloned this project on github, and I gave an npm install, it downloads the dependencies, but when I Yarn start to start the server, it prints me this error.…
-
1
votes3
answers2526
viewsHow to add HTML with onClick event in React
It may seem like a repeated question, but the examples I found are complicated and need a predefined array, I don’t have that, I wonder what is the simplest way to add an element to the DOM with…
-
1
votes1
answer57
viewsIncrement of the Hooks in the React
I’m venturing into the world of React and I realize that now there are Hooks. I would like to understand: What was the need to implement this Feature; and: What would be the advantage of using Hooks…
reactasked 5 years, 5 months ago Gustavo Silva 33 -
1
votes1
answer653
viewsWhen to use Redux and state in React
I realized that we can use Redux and State to work on React. When to use one or the other?
-
1
votes1
answer305
viewsPass component to the child
There is a way for me to pass a specialized component to a child by props? I have a situation where I want to reuse as much as possible, without having to duplicate it, and I don’t really understand…
reactasked 6 years, 8 months ago André Agenor 93 -
1
votes1
answer28
viewsStoring data from a constant as props
I have the following constant: const: lista = [{ id: 1, poke: 'Pikachu', desc: 'Pokemon do tipo elétrico', }, { id: 2, poke: 'Squirtle', desc: 'Pokemon do tipo água', }] And I need a component to…
-
1
votes1
answer29
viewsHow to set a state that is in a constant with React with a function
I have the following code snippet: const [aulas, setAulas] = React.useState([{ id:1, title: 'Aula 1', descricao: 'Matemática', }, { id:2, title: 'Aula 2', descricao: 'Portugues', }]) function…
-
1
votes1
answer670
viewsResponsiveness using React and Bootstrap
I have a problem that I’ve been trying to solve for a long time, and I can’t, which is to let the layout of the site pick up the whole page, it stays this way. https://ibb.co/cHEeS7 (print of how…
-
1
votes1
answer994
viewsHow to create component hierarchy with React Native?
I want to create components with Textinput, the default being my mask-free Input component, and the kids will have a mask or some other treatment. I currently have the default input that contains…
-
1
votes3
answers6815
viewsEslint captured an error, Parsing error: Unexpected token =
Hello, I installed Eslint to capture the errors and check the code, but the same is picking up this error on line 28 "updateDay = () => {" where the problem is in this syntax with = before (),…
-
1
votes1
answer250
viewsPicker does not manually select
I have this Pickeruf component, which displays the list of states. import React, { Component } from "react"; import { StyleSheet, Platform } from "react-native"; import { Picker } from 'native-base'…
-
1
votes1
answer79
viewscontext Api shows no value in the Consumer
I started to study context api now, I believe I am making my code with the same structure as the tutorials, but the value target Component receives nothing, there is only a blank where it should…
-
1
votes1
answer734
viewsHow to validate phone with React-Native sms
In the app I’m working on after logging in by facebook the user needs to fill in his data, including his phone, but I need to confirm the user’s phone by sms before allowing him to save the data The…
-
1
votes2
answers970
viewsTake the data from a dynamic form and pass to an array type state
I’m trying to get the data from inputs dynamics and pass to the state (handleChange), but I can’t, because you’re only taking the values typed in the first input and when I type in the others, it…
-
1
votes1
answer480
viewsReact using Redux, not saving application status
I’m trying to implement redux in my app Web react, does not give any error but also does not work, when I try to capture state is as undefined structure: App.js Routes.js store/actions.js…
-
1
votes1
answer60
viewsAdjacent JSX React syntax error
I created a component that there are six images but when compiling my code returns me the following error. And this is my source code for the Imovelphotos component import React from 'react';…
-
1
votes1
answer2503
viewsImporting css into React JS
Good morning, I am new to React and I am trying to import a css file into my Cabecalho component, however I am not able to do this with normal import, I would like to know how to do this because it…
-
1
votes1
answer1092
viewsReact with Material-UI: Changing component colors
I have a question about the buttons (I think it will heal the other components too). There is the property color, by default I can use primaryor secondary, Both come along with the material. But…
-
1
votes1
answer172
viewsRecover item index in list to delete
I’m trying to make a demo application for bookmark registration (Bookmarks). I can retrieve in a list what I type in the 3 inputs I have on my screen (Description, URL and tag), and I can include as…
-
1
votes1
answer589
viewsPass parameters(including an image) to PHP with Axios using formData
I created an React component to be my custom input button: getFormData(){ var formData = new FormData(); var imagefile = document.querySelector('#btn_file_logo'); formData.append("image",…
-
1
votes1
answer195
viewsHow I can create a Component in React js to publish on NPM
I have a question, need to create a component in React js is to publish it in NPM. I managed to publish it, however it keeps giving error to transpilar from js to jsx or from jsx to js. so when I…
-
1
votes1
answer399
viewsProblems with APK React-Native
When I compile the project it generates the APK in the briefcase C:\Users<usuario>\Desktop\projetos\appTeste\android\app\build\outputs\apk. If I catch the APK and put in a cell phone it…
-
1
votes1
answer537
viewsReact Native - fetch(url) always returning a Promise
I’m starting in React Native, I had no problems until I started making HTTP requests. I’m using this function: async getJSON(url, parameters){ try{ //check if URL isn't empty if(url.length == 0)…
-
1
votes1
answer23
viewsI cannot use defaultProps in React
I’m a beginner in React, and I’m trying to set a default value for a prop if it’s not passed, but it’s not working. Title.js import React, { Component } from 'react'; export default class Title…
-
1
votes1
answer629
viewsReact Native application using Firebase
Hello, I am creating an application using React Native, and trying to integrate with Firebase, I found an application of Starter project, which already has the integration ready, just need to add…
-
1
votes1
answer83
viewsGet value of Children and props in React
I need to get the children of a component and also its props. Someone knows how to do it? Example: <ElementPai value="text1" title="text2" colletion={valorArray}> <ElementFilho1/>…
-
1
votes0
answers326
viewsReact - Modal display black screen
all right ? I have a problem of displaying a modal in a Komponent React, it happens that when we click to present the modal display the screen turns dark and ends up crashing the browser In the code…
-
1
votes1
answer36
viewsReact-Native Route Flux does not work
I tried to do everything, when I compiled after having installed the Flux Router, an error appeared saying that I was in need of some modules, such as React-Native-Gesture-Handler and…
-
1
votes1
answer2505
viewsChange attribute of an object array in the state in the application
to try to make an attribute of one of the objects in an array of objects switch between true and false follows code: Initial state: constructor(props) { super(props) this.state = { post: [{ nome:…
-
1
votes0
answers51
viewsPassing data by context (HOC) React
Good, I’m doing a form system in React. I’m using the context to pass some information to the child components. The structure of the project is as follows: /context - Where I’ve been saving the…
-
1
votes1
answer1390
viewsHow can I change only one property of an object using the useState hook
I wonder how I can change only a specific property of an object using the useState hook const [value, setValue] = useState({value1: "abc", value2: "abcd"}) How would it be possible to change only…
-
1
votes1
answer240
viewsProblem to change class in React that has Responsive Bootstrap Menu
I’m making a site with Bootstrap and Reatjs and this site has a responsive menu. This menu looks like this (example): Dashboard Register User Administrator Every time I click on one of the menu…