Most voted "react-dom" questions
The React-dom package provides specific DOM methods that can be used at the top level of your application as an exhaust valve to exit the React model if you need to. Most of its components should not need this module.
Learn more…28 questions
Sort by count of
-
10
votes2
answers12658
viewsHow to comment code block in JSX (React)
I want to know if it is possible to comment on a code block inside the render() method in React, I tried every way I know and none of them worked. render() { return ( <div className="Events">…
-
5
votes1
answer192
viewsBug when reordering React component list
I have a component that loads a list of components <ComponenteReordenavel> which is reordered according to the user’s taste. The bug happens when I modify the style of that component and…
-
2
votes1
answer3545
viewsDestroy React Component (Unmounting Component)
I would like to know how to destroy a component with React by clicking a button. I found a way out, but in my conception it is quite "gambiarrosa". I have a state called show and when click on close…
-
2
votes1
answer416
viewsState returning wrong/late value
The application: by clicking on a button, an event onClick is fired and a fetch There is an API that returns data in JSON is performed. Right after this data is transformed into an object, the…
-
2
votes1
answer47
viewsSingle React "key" problem
I am trying to create a chess game using React. I am doing very well except for this mistake. This is my code: import "./style.css"; function App() { const squares = []; //squares order for (var…
-
2
votes1
answer73
viewsHow to use the React useRef hook with the Numberformat component?
I am using the lib react-number-format to take a value as formatted currency in my form and then save it to a state. Currently it is this way: <NumberFormat thousandSeparator={true}…
javascript react react-hooks number-format react-domasked 3 years, 9 months ago Danúbio Vieira Lima 397 -
1
votes1
answer1609
viewsAdding Component Dynamically in React
I’m trying to dynamically add one component inside another in React. So that I click on some element and in onClick it adds this component together to the specified div. I tried to do it this way:…
-
1
votes1
answer938
viewsHow to update properties in React "setState"
I’m trying to add objects to 2 properties of the Fecthapis component. I make the call to both Api’s, and I get the request with the expected objects. However, when I try to include these objects in…
-
1
votes1
answer2088
viewsHow to create an React component from select that in the bind event "change" picks the right value that was selected?
Good night! I am trying to make a select component that is used more than once within another Parent component. To create the "option" tags, I map inside the array I created as a state of the…
-
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
votes1
answer1821
viewsThe data property does not exist in type 'Intrinsicattributes & Intrinsicclassattributes & Readonly & Readonly<{ Children?: Reactnode; }>'. ts(2322)
Português: The type '{ data: Undefined; }' cannot be assigned to the type 'Intrinsicattributes & Intrinsicclassattributes & Readonly & Readonly<{ Children?: Reactnode; }>'. A…
-
1
votes1
answer25
viewsWhat would the same code look like in Reactjs using Hook to rescue the start of component creation?
With the code just below I want to simulate the same effect with React Hook in the componentWillMount method contained in classes for reactjs? Example below with code: class Example extends…
-
1
votes3
answers1189
viewsHow to structure React Js folders and files?
I’m starting to learn React Js and I’m intending to create a website on it, but I was left with a question. The React Js is the component base, right? I have the App.js where I call my own…
-
1
votes1
answer50
viewsProblem rendering the Component that has a function in useEffect
I created in my project a "Slide show" component that has the function below to perform the automatic slide. However, when going to another page using the useHistory push function…
-
0
votes1
answer1678
viewsonClick on dynamically created React components
I have a component user-defined called <Match> that is created dynamically within another component <Event>. But when putting onClick on the component an exception is popped. How to…
-
0
votes2
answers1389
viewsHow to put the image address in src without it having to be a Component in React
Good evening I have a js file with an array of objects and one of these properties is image as I do to render it in src already tried {item.image} but it’s just a string and React apparently uses…
-
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
answer481
viewsRedirect after post in api with Reactjs files
Good morning, I am trying to create a login screen in Reactjs where a post is done on an api, after sending the user email and password, the API returns the JWT authentication token. API post in my…
react login react-router react-dom reactive-programmingasked 5 years, 6 months ago Daniel Pelissari 55 -
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
answer347
viewsComponent in Reactjs re-rendering child components without need, how to get around this?
When a component Father consequently updates its Son(s) (s) also and(are) updated(s), without at least changing any value of its props and states, for example: function Filho({item}) {…
-
0
votes1
answer168
viewsReactjs - setState does not work with the first value in onClick
Bom di! I’m using React in version 16.11.0 and every time I use setState using function, the first value I Seto, it always comes blank. Follow the example below: //Declaração do State const [senha,…
-
0
votes0
answers196
viewsRedirect to another component by passing ID via table button in React
I have a process component that should redirect me to another component, this other component will need to receive the process.ID, in order to render the records referring to the process. I created…
-
0
votes2
answers55
viewsHow to use Reactdom to create Buttons through conditions
How can I create these Buttons within my <div className="box-statusA"> when arriving in the indices of the status chosen import React, {useState} from 'react'; import ReactDOM from…
-
0
votes1
answer197
viewsComponent is rendered again whenever some input state is changed
Good morning guys. I am developing an application where the user registration is according to the option that it selects " Physical or Legal ". According to the option that he chooses a form is…
-
0
votes0
answers259
viewsReact component rendering twice
Guys I’m having a problem where my components are rendered 2/3 times and I’m suspicious of an implementation, but I’m not sure if it’s her fault. The implementation is as follows, I have a…
-
0
votes2
answers258
viewsSort array within another array with Reactjs
Staff I set up a table with the data of an array where will have attack and defense points of each player associated to a team. You will have the total points of attack and defenses of each player…
-
0
votes1
answer32
viewsPassing method with parameter
Is it possible for me to use a function of the parent component that updates the state of that same component in ANOTHER component? (this function has a parameter that would be the new value to be…
-
-1
votes1
answer52
viewsProblems with React-router-dom Withrouter
If you turn on, I started making an app and I needed a header menu for the transition, this would be a menu that is rendered on every page. That is why it was created and is ultimalized outside the…