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
votes2
answers1796
viewsFormulario Email React
I made a simple validation using react, and would like the 'b' message only to be available when the user clicked on submit how can I do? export default class LoginApp extends React.Component {…
-
0
votes2
answers1287
viewsRecover value of a props in child component
I’m a beginner with React and I’m having a hard time recovering the value of a props, in a child component. I have a component called Search, which when clicking a button, I pass via props the value…
reactasked 6 years, 7 months ago Daniel Swater 1,251 -
0
votes5
answers388
viewsHow to exclude only a certain data from a React state
Today I have the following constant: const alunos = [{ id: 1, nome: 'Julia', curso: 'Enfermagem', }, { id: 2, nome: 'Isabela', curso: 'Veterinária' }] but I would need to just erase the id data,…
-
0
votes2
answers1750
viewsHow to use JS object variables for colors in CSS
if I have an object JS for ex: cores = { main: "#333", institutional: "blue" } and I use styled components to build my styles css so I create him like this: styled.View` background-color:…
javascript css react react-native styled-componentsasked 5 years, 4 months ago Julio Henrique 4,352 -
0
votes1
answer509
viewsHow to validate a token?
I have an api in Passport, in my front end that is in React I created a private route, in this private route I called a function checkAuth, to know the user ta authenticated, but for now I made this…
-
0
votes0
answers4902
viewsCan you input masking and validation in React?
I am using several different Components and trying to integrate them. In this example here I used React-input-Mask and React-material-ui-form-Validator, I am using the material-ui inputs. Does…
-
0
votes1
answer502
viewsReact Native Maps
I am trying to implement the React-Native-maps library in my project, when running React-Native run-android I get this error in CMD: * Where: Build file 'C:\Users\Henrique\Documents\New…
-
0
votes1
answer321
viewsReact-Native-camera error classpath
I am giving this problem when I install a Dep, linking it manually or not, always from this classpath error. My code is on github if anyone wants to look. My github:…
-
0
votes1
answer2051
viewsDifference and good practices, either global or React Native context
I’m new to React Native and would like to understand in an objective way: What’s the difference between using global.variavel = foo; or create a context api? 'React recently implemented Context Api…
-
0
votes0
answers106
viewsValidating tr tags in a table with React
I have two components. The first is the parent and the second is rendered in the parent as tr tags, as lines in a table, they need validation. Because the tds tags contain inputs that need to be…
-
0
votes1
answer512
viewsRoutes with undefined parameters
I have a Flatlist where each card directs me to a new screen: render() { return ( <TouchableWithoutFeedback onPress={ () => this.props.navigation.navigate('Post', { "title":…
-
0
votes0
answers122
viewsReact-Native run-Ios does not work but Xcode does
I created a project RN 0.59 where everything was working. After the libraries are installed the command react-native run-ios stopped working. The simulator opens the application, staying on the…
-
0
votes1
answer411
viewsSort my flatList by the hour
I am filtering my flatlist by date (period), but want to put the hours in ascending order: <FlatList style={{backgroundColor: 'white', marginTop: 10}} data={this.state.progr.data.filter(x =>…
-
0
votes1
answer237
viewsReact Native Maps - CSS HELP
I’m trying to get an icon under the mapview in my project, so: But now it’s like this: Code: <View style={styles.viewMaps}> {this.state.ready && this.state.region &&…
-
0
votes1
answer124
viewsXcode error after update to version 11
Since my version of Xcode upgraded I can no longer run any of the projects I implemented, Below is the print of my problem, since Xcode has automatically updated to version 11 I come facing this…
-
0
votes3
answers1776
viewsHow to show error returned from backend in nodejs in React
I have a problem showing the error message that came from the backend. I return in the backend: res.status(400). send({error: "User already exists"}); already on the front I would like to display…
-
0
votes1
answer1423
viewsInput does not allow typing
I have a page with some inputs, I’m using React so I have some components to help when I create the form Form Code: <div className="content novo"> <Alerta ref={(ref)=>this.alerta = ref}…
-
0
votes1
answer3215
viewsError creating an application with create-React-app
I installed the create-React-app all right, but when tried to create a project using the command create-React-app hello-world of the following error:…
-
0
votes1
answer392
viewsCatch error number Axios
I’m making a request, which returns me error 401, but I can’t get this number axios.post(config.urlBase + 'adicionar_empresa', formData) .then(res => { if(res.data){…
-
0
votes1
answer104
viewsReact JS- Internationalization of images
Good afternoon, I’m using the library React-Intl to internationalize texts in pt_br and English in a React web application project, but I need to translate the images as well and I have no idea how…
-
0
votes1
answer361
viewsReact Native with PHP
Good night to you all! I have an app developed in React Native and I am consuming an API made in PHP, however the file of this API is in my machine, it is not in any server. When I upload my app to…
-
0
votes1
answer52
viewsWrap of an application
In the world of React when I speak "the components that wrap the application", what does that mean? What does it mean to wrap the application?
reactasked 5 years ago Thiago Gualberto 41 -
0
votes1
answer93
viewsAuthentication external websites
I am using JWT to authenticate access. When I try a GET request from outside my system, it displays this message: snippet of the code where I make the request (js): [...] var cep =…
-
0
votes1
answer116
viewsHow to navigate with React-router-dom when an action occurs
Hello, I’m starting to work with React and I’m doing an integration with Firebase. My problem is this, I can already fire all the actions I need, but when I fire my last action…
-
0
votes1
answer397
viewshow to render a JSON in reactJS
am starting to learn React and want to connect with a server nodejs he’s returning a JSON [{nome:"joão",sobre:"victor"}] then in React: class Page extends React.Component{ constructor(props){…
-
0
votes1
answer58
viewsReact - Build too big
I am developing a website in React with Typescript. It happens that before when doing npm run build, the briefcase build generated had an acceptable size 4mb, and eventually, after having moved from…
-
0
votes0
answers78
viewsTest functions with Jest and Enzyme?
How can I test this function with Jest and Enzyme? addProducts = id => { toast.success("Product added", { position: toast.POSITION.TOP_RIGHT }); history.push(`/product/${id}`); }; I was using…
-
0
votes2
answers92
viewsConnection between Node and Postgresql
I am creating a Node API for a personal project with Postgresql connection. Is there any way to migrate (so that records are automatically created in the database) from created models? I know how…
-
0
votes0
answers122
viewsuse props.match.params in a class
I would like to use a function that is within a class, but I would like this function to use the props.match.params to rescue the id of the product in the URL, to know which product the function…
-
0
votes0
answers203
viewsOpen Keyboard in list - React Native
I’m trying to implement a chat in my app, but when I open the keyboard to start a conversation, the conversation is released from the display. Here’s my code and a gif of what’s going on. import…
-
0
votes1
answer48
viewsIs it possible to use native components in web programming?
I wonder if I can call the native Picker dropdown from an Ios or android phone using javascript code on the web? or a React library. for example this lib of the React-Native:…
-
0
votes1
answer76
viewsCan I add functions within the render method?
It is bad practice to call functions and/or add structures (conditional, interaction) within the component render method before Return, for example: export default class Header extends Component {…
-
0
votes1
answer853
viewsTypescript with React-navigation
I have a doubt in typing the prop Navigation of a functional component, my code is currently like this: import React from 'react'; import { Container, Button, ButtonText } from './styles'; import {…
javascript typescript react react-native react-navigationasked 4 years, 9 months ago Henrique Hermes 343 -
0
votes0
answers163
viewsReact-materialize input is not working
I am facing the following problem, I created a site using only materialize and then I used the React library in the template, but now some fields are not working and one of them is the input I had…
-
0
votes0
answers30
viewsSome way to allow loading of script inserted by dangerouslySetInnerHTML
function createMarkup(str) { return { __html: str }; } function GraphicLarge({ HTMLData }) { return ( <div className="graphic graphic--lg"> { isFetching ? <div…
-
0
votes1
answer44
views(Extract-text-webpack-plugin) error [1] "Loader" must be a string
after I did the installation of Extract-text-webpack-plugin started to return me the error erro [1] "loader" must be a string follows my webpack configuration 'use strict' const path =…
-
0
votes0
answers17
viewsConstructor and Super to use state Reactjs
Hello. I am starting my Javascript studies with Reactjs and one of my doubts would be on the use of state, I did not understand very well pq it is necessary to call a "constructor" and a "super"…
-
0
votes0
answers177
viewsPOST in Reactjs with Object included, how to do?
I need to register for course instructors, in which each instructor will have a course. How do I? I’m doing it this way and it’s not going: PS.: the variable name and email receive a variable in…
-
0
votes1
answer299
viewsWhy is fetch returning a file and not the data?
I’m doing a fetch to get the data of a JSON, but the variable is getting the value of promisse and not the returned data. var data = fetch('./data/data.json') .then((response) => response.json())…
-
0
votes1
answer64
viewsHow to apply a css class to a child element of a component with javascript?
I have a component called <PDFDownloadLink> I need to change the child <a> that he owns. With syntax css I would do something like: PDFDownloadLink a { } How could do the similar with…
-
0
votes0
answers69
viewsReact Native Error
Could someone help me I received the following feedback Não esqueça de cancelar as notificações e agendar as notificações do dia seguinte quando o usuário terminar um quiz :thumbsup:. Você pode…
-
0
votes1
answer161
viewsHow to install a package manually in an React Native project?
I need to install a package in my React Native project, but when using the npm command for installation: npm install react-native-threatmetrix --save I get the following error in response: npm ERR!…
-
0
votes0
answers186
viewssetState is not working according
Hello, I’m doing an application in reactnative and I’m trying to set a state but it doesn’t work, can you help me? follows the source(Obs the handleClickFooter function which does not arrow the…
-
0
votes1
answer154
viewsMy checkbox is not ticking/unchecking
I’m implementing some checkbox with React, I can settar to initially be checked or not, but I can’t change that state. How to solve? My Main Class class NewsletterConfig extends Component {…
-
0
votes1
answer429
viewsReact Native application performance built with Expo
I am developing a mobile application using React Native through the Expo but I have been finding a small "problem". I use my physical device (android) to carry out the tests through the Expo…
-
0
votes1
answer164
viewsRedux, how to access store state variables in functions
Hi, my question is if I can access store variables in functions, something like: --usuarioReducer.js-- const initialState = { usuario: {}, isAuth: false } --root.js-- import { Redirect } from…
-
0
votes2
answers583
viewsConsuming API Reactjs
I’m new to Reactjs, when I try to consume a local API I can’t, I believe that’s the message: localhost You need to enable Javascript to run this app. My code: export default class App extends…
-
0
votes1
answer5078
viewsPass information between components without Reactjs hierarchy
How to pass information between components in React as props or status. In this situation I have a button and a menu. The menu should open every time the button is clicked. Knob import React, {…
-
0
votes1
answer366
viewsBackground image with Styled-Components in React invalid path?
I’m trying to use an image as the background of a page in a React project, I thought to import with styled-components but I did not succeed, follows a print where the picture is, and what I tried to…
-
0
votes1
answer527
viewsCallback with Redux-thunk
I’d like to know how to get a call back from dispath something like this, this with React: this.props.store.dispatch(dados, result => { console.log(result); }); On this line above the console.log…