git config --global user.name "John Doe" git config --global user.email email@example.com
If you dont want it to be global, just skip the global flag and you can set the git config just for your local projects
One of the most common performance failures in React is the unnecessary rendering of components. A library that can be very useful to detect this is why-did-you-update. Notifies you in the console when potentially unnecessary re-renders occur, super helpful for easy perf gains.
Another handy tool to measure performance is react-addons-perf.
Also remember to use
shouldComponentUpdate() method in statefull components to check that the props of a component didn’t change and skip rendering (React by default render the component). We can use
PureComponent instead of
Component. This would compare all props using strict equality
(===) and rerender only if any of the props change. If you want to achieve the same behavior but in a functional component I recommend you use `recom
How many times have you transformed a simple functional component into a Class one because you needed to be Pure?
This adds more lines of code, and every line of code has a cost — to write, to debug, and to maintain.
Why do we use the
constructor in React ES6 class components ?
Basically for 2 things:
thisis "already binded").
When creating the store in a React-redux app there are differents ways to doit, here is the simple one that allow you to consume the sotre from anywhere. What I mean by that is be able to see the store, dispatch actions and even suscribe to changes from any JS file outside React.
When working with DOM events, we have to take care of React's event pooling. Let's explain better what it is: React use a cross-browser wrapper around the browser’s native events called SyntheticEvent. With this wrapper events work identically across all browsers.
When working on a React & Redux project when have 3 diferents escenarios when using refs. But first...
Refs are a way of storing references to an object, these refenrences can be DOM nodes or class components. It provide