JS.React. Wow! SetState is async )

The discussion is here.

In my code i did like this to get the proper result of the state

setMyName(myName, f) { this.setState({myName}, ()

Читать на сайте автора.

Js.React. How do i search dom elements?

Example

const handleRightClick = (e) => { const house = document.getElementById(‘1’); // << vanila js :)) if (house) house.setAttribute(‘margin-left’, ‘200px’); house.style.marginLeft = ‘100px’; }

Читать на сайте автора.

JS. React. Components in class style and HOOKS

import React {Component, useState} from ‘react’; // destruct here … class House extends Component // for example // or example from docs class Welcome extends

Читать на сайте автора.