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
answers41
viewsHow to open a video on youtube with React Native?
I am developing an android program in React on which, the user click a button a video in the youtube application will open, but I have no idea how to integrate other programs to my
-
1
votes0
answers125
viewsLoader HTML error in Electron-webpack
I’m looking for a solution to run; Electron and React following an MVC structure. I found the Electron-webpack module that apparently extends over standard webpack. Following the documentation I set…
-
1
votes1
answer1026
viewsReceiving data via Ajax in PHP
I’m creating an application with React, and the back-end part with PHP I have ajax request: pesquisaCliente(e) { e.preventDefault(); $.ajax({…
-
1
votes1
answer37
viewsHow to use fullscreenchange in React?
I need to perform an action when the user leaves full screen browser mode (by pressing ESC). I have verified that the event called is the fullscreenchange but I couldn’t get it to work on React. I’m…
-
1
votes1
answer45
viewsReact com Typescript
Hello, I am learning to make React applications with TS, and within my studies I came across a problem. I am exporting a component as follows const Button = styled.button` background-color:…
-
1
votes0
answers56
viewsJWT and Passport returns 401 React
good afternoon. I am learning JWT and Passport and I am facing problems with the same, the problem is the following, I can log in and save in Localstorage, and redirect to another page however, even…
-
1
votes1
answer68
viewsWhat is the advantage of using the setState() function to modify an array?
I checked that it is possible to modify an array in the state in two ways: this.setState({meuArray: [...meuArray, 'novoValor']}); // ...meuArray é o espalhamento de meuArray…
-
1
votes1
answer64
viewsHow to use Generics with the props of a component?
I’m trying to create a component that will accept a generic type within the props. I’m trying to do it this way: interface Props<T> { items: T[]; } const componente:…
-
1
votes1
answer165
viewsClass change to function
I want to turn the following class into a function: class Basic extends Component<Props, State> My question is: how do I move the props and state properties to the function?…
-
1
votes1
answer1776
viewsProblem with CORS in React application
I have an application that requests a JSON via Xios. It follows the function axios.get("http://localhost/teste.json") .then((res) => { this.setState({value: res.data.tgt.screenPosX})…
-
1
votes1
answer1085
viewsProblem calling api in React JS
I created a webapi in ASP.NET Core, and I need to consume it using React, the web api works normally, if I use Curl or Postman among others, it works normally. The problem starts when I use React,…
-
1
votes0
answers54
viewsProblem when making a GET on my site when it is entered via www (React + Django)
I have a Jango application that uses React on one of your pages (not two separate Servers). On my React pages, I make HTTP requests to Django for the api using Django Rest Framework. This…
django react http-request https django-rest-frameworkasked 6 years, 1 month ago Gabriel Cavalcanti 47 -
1
votes0
answers109
viewsReact with React Router / Dynamic Configuration
I have two questions about routes, in the scope of my project, I would have to assemble it according to the json that arrives, because it can come with a different component tree. I would have…
-
1
votes3
answers205
viewsReact-chartjs-2 graphics do not load on screen
import React, { Component } from 'react'; import {Bar} from 'react-chartjs-2'; import $ from 'jquery'; //NÚMERO DE VIAGENS POR MUNICIPIO class GeraGrafico extends Component{ constructor(props){…
-
1
votes1
answer333
viewsUpdate React component with window.localStorage
I’m new to React and I have the following problem: I have three components extends ComponentI need you to communicate. They are a Navbar and two static contents. Navbar content (text and icons) are…
-
1
votes3
answers392
viewsHow to use reduce in an object array in React
import React from 'react'; const App = () => { const fruits = [ { name: "banana", cor: "yellow", price: 2 }, { name: "cherry", cor: "red", price: 3 }, { name: "strawberry", cor: "red", price: 4…
-
1
votes1
answer3828
viewsHow to move this.state from one screen to another screen with React Native
Guys, I’m new to React Native, what I want to do is catch a this.state from screen 1 for example and use it on screen 2 to print that same this.state. I made a very grotesque example to try to…
-
1
votes1
answer914
viewsHow can I get the JWT token after authenticating?
I have a spring-boot Rest API which, when a user authenticates the api returns the jwt token, I noticed in the browser that the token appears in Response Header > Authentication and in tests with…
-
1
votes0
answers23
viewsCarousel in Reactjs
Hello, I am starting my journey as a frontend and I would like to know how to make the points in a Carousel can be clicked in addition to letting the images change automatically? OBS1.:(I used the…
-
1
votes1
answer188
viewsHow to compare 2 values with YUP
Good morning I have a validation to do with Yup, and I need to make sure the initial interval is not longer than the final interval, anyone have any idea how to do that? I tried to pass the same…
-
1
votes1
answer60
viewsTest failure - setup.ts
Galley, I’m trying to run an App component test, however jest is interpreting setup.ts as a test. I’ve pointed it out as a setup in package.json, but it doesn’t work. Setup ts. import Enzyme from…
-
1
votes0
answers24
viewsReact Native Compiling for IOS and APK
Hello Folks I’m starting to I’m starting to study React Native for a project and a question has arisen. I know you have the Expo option and I know that without Expo there is no way to compile for…
-
1
votes0
answers10
viewsI have a lib in React, using Rollup and installed @material-ui/icons , error when buildar... I already imported in rollup anyway did not solve
Error occurring while buildar I added in the rollup.config the material icons and core Dep... yet the error continued the same. anyone could help? please. a suggestion..…
-
1
votes0
answers34
viewsIt is possible to input the same input, but with two different values using Ant.design?
I am using React + Ant.design and I need to create a table where each line receives the same input, however it must have different values, the way I am doing the second value replaces the first. I…
-
1
votes1
answer88
viewsHow to put multiple JSX expressions on onload in React
Is there any way to put two JSX expressions on onload? Every time I try to put two expressions he doesn’t recognize the second expression. I wanted to try to put it this way : <td onLoad={e <…
-
1
votes1
answer398
viewsHow can I hide a Component when the login search is completed
How can I pick up hide a component when the bank result is completed. Code: import React, { Component } from 'react'; import axios from 'axios'; class Login extends Component { state = { user: '',…
-
1
votes0
answers13
viewsPush Notification - Own service
I wonder if someone has already implemented a push notification service of their own, if there is such a possibility. I have a React app on and multiple cloud services that communicate by messaging.…
-
1
votes1
answer628
viewsReact Axios PUT/PATCH method Unauthorized, Laravel 5.7
The PUT/PATCH methods available in the API via the function Route::apiResource('user','UserController'); are those: GET and POST requests work normally, but in the PUT/PATCH route implementation I…
-
1
votes1
answer38
viewsHow to "set" Focus in an onClick function?
How do I leave an element focused by clicking on it? example At the moment I am making a filter page that has some buttons, but these buttons only work if I double click. (The onClick function…
-
1
votes1
answer72
viewsMy onClick button is not working on next js
onClick buttons are working normally on other components, except in this specific case. Obs: I’m using Styled Components for these components around. import ContainerForm from…
-
1
votes1
answer49
viewsDoubt about use of npx together with npm
I have a question about the use of npx. When I use the npx to create a React project, it uses the Yarn to install the packages behind the scenes. I was wondering if you had any way of using the npx,…
-
1
votes1
answer3091
viewsChange element color with React
I am trying to change the color of an element based on the status string. Ex.: Green to 'Active', Red to 'Inactive', Gray to 'Blocked' I managed to do this in JS Puro, but I’m having trouble making…
-
1
votes1
answer73
viewsHow to update Redux’s global status in an React application after posting to the API?
An React form that you enter with name and text. The application uses Redux global state, it pulls an Axios API and posts to the API with the form data. When I do a new post I want to update the…
-
1
votes2
answers130
viewsProblem with setState in React Native: "Can’t call 'setState' on a Component that is not yet Mounted."
all right? I’m a beginner in React Native and in this app I’m making I can’t call 'setState' in the method I created. The name of the method I created is called includingMed() and I call it here…
-
1
votes1
answer331
viewsReact Native request the api via navigation response
Main.js import React, { Component } from 'react'; import api from '../service/api'; import { View, Text, FlatList, TouchableOpacity, StyleSheet } from 'react-native'; export default class Main…
javascript react react-native react-router react-navigationasked 5 years, 8 months ago Felipe Santos 96 -
1
votes2
answers57
viewsProblem with clearInterval in React
I’m having a problem with React trying to use clearInterval. He’s not stopping the break created by setInterval. Can you give me a hand and see what I’m missing or what I’m missing, please? function…
-
1
votes1
answer62
viewsComponent update in React via websocket
Hello, I have a component in React that connects to a websocket with the following parameters (NUM_ITEMS=100, MSGS_PER_SECOND=100). Therefore, I list a table with 100 items and update them by ID to…
-
1
votes1
answer49
viewsTrying to turn canvas code into pure Javascript for React
I’m making a piano mini-game similar to Guitar Hero, where blocks fall from the sky and you have to press the note (in my case, the piano note/key) equivalent at the right time, they fall in…
-
1
votes0
answers10
viewsValidation of days interval
Personal talk, I need to validate an interval of days. These intervals are composed by starting day and end day. In my bank I have the following records: [16,31] [32,45] [45,70] [90.99] The first…
-
1
votes1
answer32
viewsWhat are the main differences between REACTJS and Handlerbars?
I’m starting in web development now, I’ve learned to develop a simple application on the web. I am using handlebars as my view engine, but I would like to know the difference between reactjs and…
-
1
votes2
answers58
viewsChange the array data coming from the api
I have a question in an application on React Native I’d like your help. How do I increment a new item in the array that comes from the api. The array of api today returns so: data:[{ id:1,…
-
1
votes1
answer123
viewsAlways rendering all the code, changing state!
With this scolding, I start generating this array with the 60 blank positions (initially) let [list, setList] = useState(Array(60).fill("")) Then with this array will serve to generate all 60…
-
1
votes2
answers153
viewsHow to set a target Theme-color in Runtime from the application styles
I’m developing a React-based web app that uses Material Components (which in turn uses Sass) and requires the color of the browser bar (defined via html meta, as shown in the following code) to be…
-
1
votes1
answer172
viewsReact - Redux, how can I modify a complex object?
I am trying to modify some properties of an array through an index coming from mine payload. The code below goes through the array looking for the index and tries to modify its properties. This even…
-
1
votes2
answers52
viewsDoubt in the structure of the code
In that code: class ShoppingList extends React.Component { render() { return ( <div className="shopping-list"> <h1>Shopping List for {this.props.name}</h1> <ul>…
-
1
votes0
answers28
viewsPrevent state from being lost when using history.push() - React-router-dom - Reactjs
I have a component that calls the API and stores the return in the state to display to the user. However, when I use the history.push() to navigate to another application page and then use the…
-
1
votes1
answer4677
viewsUndefined is not an Object (evaluating '_this.props.navigation.navigate') React Native
I have this signOut function that I call through a button, but when I press the exit, where it calls a onPress: () => this.props.navigation.navigate('SignIn') it returns the following error Does…
-
1
votes1
answer41
viewsFunction onClick in the inside of a form is not working properly
For some reason, the onClick function belonging to each of the images is not working properly... "index" should be the inside of the image itself, but React acts as if all the images had been…
-
1
votes1
answer1128
viewsReact Starter. Take data typed in Input
Hello I’m studying the Reactjs... and made the following structure: [code] class MyNascimento extends Component { constructor(props) { super(props); this.state = { nascimentoValue: null, }; }…
-
1
votes1
answer20
viewsHow to join two values of an array into one?
For example: If I have an array that stores the hours and another array that will store the minutes const arrayHora = [10] const arrayMinuto = [53] How would you join the two values of the arrays…