Js.React.Reselect

Source

selecting data from the state and transfer calculations from view to selectors

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

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

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

JS.React. Components in functional style

install react

npx create-react-app my-app cd my-app npm start

Source code

What is interesting ?

Example of component

import React from «react»; import cc from

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

Js. New way of creating methods in objects

// lets say we have some object here let range = { from: 1, to: 5 } range[‘anyMethod’] = function(){ return ‘hi from new way

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

HTML.CSS.BoxModel

Here is the box model

this will squeze box to definite size, for example 300 px width

box { width: 300px; box-sizing: border-box; }

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

HTML.CSS.Relative font size

This code will increase font size to 90 px. 3em means multiply to 300 %.

… <head> <style> body { font-size: 30px; } </style> </head>

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

HTML. CSS. Priority rules

Merge and overriding. Stylesheet (0) – > Style in header (1) -> Style Tag in other tag (2). In embraces the priority of the tag.

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

HTML. CSS3. Style Placement

There are 3 ways of styling html page

From external file, linking through <link> tagFrom <style> tag on the pageFrom inline <style> tag inside some

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