React hooks decouples state management from class based react component and allow it to be consumed in functional way. However the overwhelming limitation of “Don’t call Hooks inside loops, conditions, or nested functions” brings a lot of headache to developers. There are 5 most useful hooks. const [state, setState] = useState(initialState); useState is a…
Category: Front-end
Flux, Observer, Factory pattern and Redux
Redux is an implementation of Flux pattern which aims to solve the state management issue in large scale complex react app. Flux pattern at its core is pipe line: An action dispatches an event. Event is send at data store and triggers an mutation of the data. Then the data mutation triggers the view…
Super useful Arrow Function in React
To avoid the annoying function binding in react components classes constructor(props) { super(props); this.myFuncInClass = this.myFuncInClass.bind(this); } Install the following plugin via npm and enable it babel-plugin-transform-class-properties Then you can write arrow function and void the binding. myFuncInClass = () => { // code } Be aware about the difference between Arrow function expression and Traditional function…
The complete React life cycle methods diagram
“Relearn CSS Layout” – shows the modern / preferred way to achieve certain layouts using modern CSS
https://every-layout.dev/layouts/stack/