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
answers45
viewsjustifyContent: 'flex-end' does not align at the base
I am trying to add a product value bar at the bottom of the application, using the justifyContent: 'flex-end' but the content does not go down, it is pasted in the View that comes above. The code is…
-
0
votes1
answer36
viewsID Undefined in Auth.currentUserInfo() aws-sdk function
Hello I am using the sdk of aws, to recover the information of the logged in user I am calling the method: Auth.currentUserInfo(); But he returns the object: attributes: { sub:…
-
0
votes0
answers27
viewsHow to sort array using Sort
I have an array of objects that returns 3 possible sensitivity values: "LOW", "MEDIUM", "HIGH". But with the code below it is ordering in "HIGH - MEDIUM and LOW" respectively in ascending order and…
-
0
votes0
answers33
viewsHEROKU - REACTJS Unexpected token '<'
**import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './app/app'; import reportWebVitals from './reportWebVitals'; ReactDOM.render( <App/>,…
-
0
votes0
answers462
viewsConsuming C# Web Api with Reactjs
I am trying to consume a Webapi created in C# webApi2 in an application created in reactJs, when I request the Api using the browser or Postman I have the information returned, but when I try to do…
-
0
votes1
answer45
viewsProblem with Typescript + Styled-Components
Good afternoon! I am starting to use Typescript and came across some problems in the configuration of the React project, using Typescript and Styled-Components! I am using module statement,…
-
0
votes0
answers20
viewsWhat would be a good practice for updating Tokens to avoid a 401 return
Guys, I have a problem where the token ends up expiring at the time of a request POST. I currently update the token on expiry of the token: keycloak.onTokenExpired = async () => { await…
-
0
votes0
answers15
viewsSorting values in mui-datatable
I’m using the mui-datatables , someone can tell me how to adjust his ordination which apparently is organized only by the first digit of the value ?…
-
0
votes0
answers23
viewsWrapper every 3 items in a listing
I have an api that returns me a list of customers and I have the following layout, my question is how to put the light gray bg div every 3 items. Just follow my code. <Grid container…
-
0
votes1
answer39
viewsError testing in Registry/React Authentication
I am working on an application, in which the tests are already defined. After the implementation I am having some errors such as: src/tests/Homepage.test.js ● Test Homepage Component uses Router for…
-
0
votes0
answers13
viewsHow to make a variable receive all native CSS properties from React
I need a variable to receive all the native css properties of React in it var cssStyle = React.CSSProperties; this my example didn’t work
-
0
votes0
answers12
viewsHow do I access a JSON property that contains a hyphen in React?
All right? I have a question and a problem!!! I believe the title speaks for itself.... But how do I access a Json property that contains React hyphen? Example of how the property can be: {…
-
0
votes1
answer940
viewsHow to change the style of a <Textfield /> from Material UI
I’m trying to change the focus color of Textfield but I can’t with any method described in the documentation. <TextField className={styles.Input} required label="DDD Origem"…
-
0
votes2
answers1286
viewsTake variable parameter Javascript/React function
How do I take a function parameter and use it to pick up a variable? For example, in this code: import React, { Component } from 'react'; export default class Home extends Component { state = {…
-
0
votes1
answer1853
viewsConsume data and make Dynamic Form with React
I need to consume the data of a webservice to create a form interface for dynamic filling, that is, it must adapt the form structure received by the webservice and not be fixed with the questions of…
-
0
votes0
answers34
viewsMap() item going through multiple requests
The code below worked the way I wanted but in the last test something went wrong. I do a map where the item went through several requests and at the end I defined my object and then a new item would…
-
0
votes0
answers21
viewsrender in nextJs
thank you so much for already paying attention here! <3 i in my landgpage, is presented 5 links, such links are saved in an array of Object and in each Object has the 5 links, and each position…
-
0
votes1
answer43
viewsTag Img does not render image from local folder Assets
I can’t access the image, it doesn’t appear.…
reactasked 3 years, 9 months ago Juvenal Bruno Andrade 3 -
0
votes1
answer25
viewsJSX elements included in closing tag
When creating the div with the SERVICES name displays the following error: Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>? <div…
-
0
votes1
answer103
viewsHow to run a Javascript function after loading the DOM using React Hooks?
I need to create several li tags based on an array and then insert them into a div, however I need to wait for that div to be created before doing so. Since React doesn’t have Domcontentloaded what…
-
0
votes0
answers40
viewsRedux with multiple application instances
If Redux maintains a single component state and I have multiple instances of the application being used by multiple users, this means that users will view the same state in components? How to solve…
-
0
votes0
answers1744
viewsAxios.Create by changing http baseurl to https
Good afternoon. I have the following code in a study project on Reactjs that I am using Axios for requests. import axios from 'axios'; var url = 'http://site3.htempurl.com'; const api =…
-
0
votes0
answers778
viewsTypeerror: this.props.user.map is not a Function - React Js
Hello, I’m training a little bit with the github api. I divided my component into a card (it has user information and etc) and in the view. I’m doing the fetchData in the view and rendering on a…
-
0
votes1
answer41
viewsTitle on the back button
import React, { Component } from 'react'; import api from '../service/api'; import {View ,Text, StyleSheet, Image, FlatList, Dialog} from 'react-native'; import Cabecalho from…
-
0
votes0
answers20
viewsReceive information from Google Routes with React Native
I have an application in React Activate with React-Native-google-maps-Directions and I need it to receive information from google routes in real time. For example, "turn right", "turn left". It is…
react react-native google-maps google-maps-android-api-2 bluetoothasked 3 years, 9 months ago Carlos Henrique 1 -
0
votes1
answer41
viewsWhere to place a Modal "const" of the Material UI inside a Class in Reactjs?
I have a problem of not knowing where to put the const "const [open, setOpen] = React.useState(false);" of a Modal from the Material UI, within my Generatereport class. When I put " const [open,…
-
0
votes1
answer50
viewsReact Native - button a js file calling a function or variable in another js file
I need some help here: I have 2 js files: Header/index.js and Main/index.js In Header/index.js there is a button: <TouchableOpacity onPress={() => {}} /> In Main/index.js you have: const…
-
0
votes0
answers54
viewsState 'Undefined' with React
I am making requests to an API through 'Aces', but the following error is happening: My code: import React, {Component} from 'react' import {GridItem, Tabs, Tab, TabList, TabPanels, TabPanel, Image}…
-
0
votes1
answer189
viewsCheckbox reactjs with default value
I am working on an application with React, however I am beginner in the subject and found a problem. I want to generate a template to be used later, and the options of this template are optional and…
-
0
votes0
answers34
viewsThe option to create an ASP.NET Core web app does not give me the option to create an app with React
Good personal evening I’m having a "problem" in creating a new Web application ASP.NET Core. When I choose the . NET 5.0 option it does not appear that screen that has the option to create an app…
-
0
votes0
answers10
viewsEnzyme - Check whether a function of a Functional Component has been called
I have an React project that had unit tests with Jest and Enzyme. Inside the component I want to create a unit test, I need to know if an internal function (myFunction in the example below) of the…
-
0
votes1
answer508
viewsProblem going up a page in React
I am creating a page for myself. I installed Nginx and directed the index.html for my React project. But when you go to the page it’s blank (Shouldn’t). Nginx and React are working because the page…
reactasked 5 years, 8 months ago Vinicius Morais 1,293 -
0
votes1
answer23
viewsHow to run WEP API Node and a Reactjs Project on the same machine?
I have running a Web API at the address localhost:3333 and a Reactjs Application at localhost:3000, however when I try to perform some request with fetch the browser returns Cors error. Is there any…
-
0
votes0
answers16
viewsHow to get a response from an asynchronous call in JS?
Hi! I’m doing a query in a database. I need to display this query as soon as possible, and I am not knowing 'encapsulate' it with the await or whatever. The function is as follows: const…
-
0
votes0
answers17
viewsIs it bad practice to use native browser Apis with React?
I’ve been using React for a short time, and I use the browser’s native Apis a lot, for example to add or remove classes with events. My question is, is this a bad practice? I should try to make…
-
0
votes1
answer42
viewsHow to import an external library into REACT.JS
I am trying to import an external library directly from the browser in REACT.JS, which would be in HTML: <script type="text/javascript" src="https://bibliotecahipotetica..."></script>…
-
0
votes0
answers14
viewsWhat is the difference between withApollo and graphql?
In some React projects, I have two situations that seem to have similar purposes, but I don’t know exactly how each reacts to a graphQL call, a Mutation call, or a simple restful API call: Both are…
-
0
votes0
answers27
viewsHow to prevent an Event Switch globally?
created an Event Listener in App.js with the following: useEffect(() => { window.addEventListener("scroll", e => { scrollToSection_DataLayer('#section1');…
-
0
votes0
answers168
viewsImage in Drawer updating several times
I’m building an application with React Native and React Navigation, I’ve made all the settings and it’s working, however, when Drawer is triggered the image is updated multiple times without causing…
-
0
votes1
answer2001
viewsXmlhttprequest failing due to No 'Access-Control-Allow-Origin' [React/Mongo/Axios]
I have a backend running on localhost with the following code: server.js: const port = 3003 const bodyParser = require('body-parser') const express = require('express') const server = express()…
-
0
votes0
answers31
viewsHow to access the value in another Component?
People started using React recently, and I have a problem. I need that when the user clicks on the Mycomponent button the increment is shown in the App. export default class MyComponent extends…
reactasked 5 years, 8 months ago Mateus Moreira 1 -
0
votes0
answers15
viewsJson-server api does not render images
Good morning, I created an Ecommerce api with json-server and when I do the rendering component on the screen, the api images does not work, my project is divided into two folders, api and web, the…
-
0
votes1
answer71
viewsWhen should I use "{ ...props }" instead of "props" in React?
I’m done some testing and somewhere I saw they were using { ...props } in the component parameter. What’s the difference of using { ...props } of only props? export default function Botao(props) {…
-
0
votes0
answers34
viewsWhy is rendering occurring in a disorderly manner even using async / await?
I’m using React and Typescript. The application aims to record schedules. In the onChange() date selected by the user, call the function handleChangeData(), in it triggers the date update by…
-
0
votes1
answer110
viewsidentify button when clicking
hello I have a problem: I have the boot component const Botao = (props) => { const classe = "Botao" const classes = [props.active,classe].join(' ') return ( <button onClick={props.click}…
-
0
votes0
answers25
viewsReac Hook Form - Submit button only activates when I press tab or click off inputs
Even by entering the password it only activates the send button when I click out of the input or tab. Why is this happening? How can I correct? const {register, handleSubmit, formState:{errors,…
-
0
votes0
answers1273
viewssaving authentication data in localStorage React js
I am developing an application in Reactjs and using Axios to work with requests and need to keep user data saved in localStorage, but something is missing in my code, as this giving Undefined in the…
-
0
votes1
answer1163
viewsReact - Why does using a global variable to store this make React see only the last reference?
I am learning reactjs and I came across a situation that I need help to understand, and being specific I couldn’t find any reference to it. I have the file Input.js import React, { Component } from…
-
0
votes0
answers9
viewsHow to change the color of the Chartjs Chart Colors?
Whoa, whoa, so... I’ve been working with Coreui (it’s a tamplate based on bootstrap-4 and React to create interfaces) in this, I wanted to implement a graph, and the graph from what I saw in the…
-
0
votes1
answer936
viewsAnimations using React.js
Currently I have researched how to make animations with React.js, but from what I understand, people use css Transitions group, there is no way to make animations simpler using only javascript, as…