Flex Layout in React Warfare Notes (Part I - Container Properties)

Zero, preface I've been summarizing Android recently, and I've forgotten about the front-end. Flex layout has been heard before, but it has not been studied in detail. Take the opportunity to play with React. How to learn a new knowledge, a lot of parameters are confusing, my favorite sentence is: the only way to deal with change ...

Posted by laurus on Wed, 20 Mar 2019 10:51:28 -0700

React - - react component creation, distinguishing between React.createClass method and class App extends Component method

createClass is essentially a factory function, and extends approach is closer to the class writing of the latest ES6 specification. The grammatical differences between the two methods are mainly reflected in the definition of methods and the declaration of static attributes. createClass method definitions are separated by commas, because creat ...

Posted by nicdp on Sun, 10 Feb 2019 23:21:18 -0800

React dynamically adds and deletes dom <li><td>

thought In the world of react, all state changes (data changes) drive dom changes. Dynamic addition of dom does not append a < li > or a < td > like jquery before, but dynamically adds dom by loading < li > or < td > data array []. The following example implements the use of antd's component library. Reference resourc ...

Posted by tinyashcities on Sat, 09 Feb 2019 00:48:18 -0800

In react scaffolding (create-react-app), extend the use of less/scss/sass style preprocessors

In projects built using the creacte-react-app scaffolding, less, scss, sass and other style preprocessors are not supported. If style preprocessing is needed in a project, it only takes three simple steps. Use NPM to install style preprocessing packages (npm install less - save-dev) Find webpack.config.prod and webpack.co ...

Posted by dartcol on Tue, 05 Feb 2019 06:27:17 -0800

React 16 Jest ES6 Class Mocks (simulation using ES6 grammar class) Example 2

Reprinted address React 16 Jest ES6 Class Mocks (simulation using ES6 grammar class) Example 2 Project Initialization git clone https://github.com/durban89/webpack4-react16-reactrouter-demo.git  cd webpack4-react16-reactrouter-demo git fetch origin git checkout v_1.0.30 npm install ES6 Class Mocks (simulation using ES6 gramm ...

Posted by cronus on Mon, 04 Feb 2019 16:33:16 -0800

Block Chain Introduction Course eth Source Code Analysis p2p-udp.go Source Code Analysis (I)

Brotherly Block Chain Introduction Course eth Source Code Analysis p2p-udp.go Source Code Analysis (I) The network discovery protocol of p2p uses Kademlia protocol to deal with network node discovery. Node lookup and update. Kademlia protocol uses UDP protocol for network communication. Reading the code in this section suggests looking at the ...

Posted by johnkelly on Fri, 01 Feb 2019 00:54:15 -0800

didFocus and didBlur of React Native

1. didFocus and didBlur Explanations didFocus - the screen focused (if there was a transition, the transition completed) didBlur - the screen unfocused (if there was a transition, the transition completed)   didFocus means that the current page will be called once when it is first loaded. didBlur is called once when the cu ...

Posted by Jarl on Mon, 28 Jan 2019 12:06:14 -0800

React in-depth-handwritten implementation of react-redux api

Introduction: Simple implementation of react-redux basic api react-redux api review <Provider store>Place the store in context, and all the subcomponents can get the store data directly. Make Redux store available to connect() methods at the component level The root component should be nested in <Provider>. ReactDOM.render( < ...

Posted by artin on Sun, 27 Jan 2019 09:36:14 -0800

How to build a project based on react, webpack 4, Babel 7 (1)

Preface Writing front-end projects for so long, the previous dva framework, and later the create-react-app framework, need to make some customized changes for the team. A little vague about the workflow of webpack and the upgrade of webpack@4 according to the official document of webpack have greatly improved the performance, while create-react ...

Posted by trace on Fri, 25 Jan 2019 10:39:14 -0800

React error "Cannot read property'setState'of undefined"

App.js import React, { Component } from 'react'; import './App.css'; class App extends Component {     constructor(props){         super(props);         this.state = {             num: 90         }              };     handleClick(){         this.setState({             num: this.state.num + 1         })     };   render() {     return (     ...

Posted by greekuser on Fri, 25 Jan 2019 04:57:14 -0800