Pluralsight has lot of High Quality Developement Videos
👨💻 By Google Chrome Developers
👨💻 By Rajat S
9 Useful Tips for writing better code in React: Learn about Linting, propTypes, PureComponent and more.
Know when to make new components
Component vs PureComponent vs Stateless Functional Component
👨💻 By Indrek Lasn
useEffect, you can handle lifecycle events directly inside function components. Namely, three of them:
Cleanup function you can (optionally) return from
useEffect isn’t only called when the component is unmounted. It’s called every time before that effect runs – to clean up from the last run. This is actually more powerful than the
componentWillUnmount lifecycle because it lets you run a side effect before and after every render, if you need to.
Another way to think of this array: it should contain every variable that the effect function uses from the surrounding scope. So if it uses a prop? That goes in the array. If it uses a piece of state? That goes in the array.
It will print “mounted” after the initial render, remain silent throughout its life, and print “unmounting…” on its way out.
This comes with a big warning, though: passing the empty array is prone to bugs. It’s easy to forget to add an item to it if you add a dependency, and if you miss a dependency, then that value will be stale the next time useEffect runs and it might cause some strange problems.
useState is stateful (read more about useState). It only uses the initial state once, the first time it renders. After that it’s ignored. So it’s safe to pass a transient value, like a prop that might change or some other variable.
👨💻 By Brian Neville-O’Neill
querySelector- Note that
$(".some-class"); // instead of document.querySelector $$(".some-class"); // instead of document.querySelectorAll
$0. After inspecting an element you can access it in the console by typing
console.table()- Gets the logs of Array or Objects in a table.
document.designMode = 'on'- edit the text of any webpage.
👨💻 By Mustapha
Chapter 9 Done