A Higher-Order Component is a function that takes a component and returns a new component.
Helps to omit unnecessary context, state setters or anything else you don't want to propagate with
Provides a handy way to use some of React Component Lifecycle methods.
Helps to debounce handlers like
Helps to throttle handlers like
e.preventDefault() side effect from handlers like form submitting or clicking a link.
Provides safe versions of
requestIdleCallback which will be cleared/cancelled automatically before component is unmounted.
Invokes a callback on prop change, useful to decouple side effects like
onChange handler in a declarative way.
Invokes a callback on prop change while condition is true, useful to decouple side effects like
onChange handler in a declarative way and control loops.
Invokes a callback once condition is true (while previous check was false), useful to decouple side effects like
onError handlers in a declarative way.
console.log with props or any custom message into render.
debugger into render.
…and more to come
You can follow me on Twitter for updates.
- Create a new folder in
packages/, let's say
package.jsonin already existing packages and create new
- Put source code in
with-foo/src/, it will be transpiled and bundled into
- Put tests written with Jest in
- Put demo in
with-foo/demo/, it will be rendered and wrapped with HMR.
Available scripts using Start:
yarn start build <package> yarn start demo <package> yarn start test yarn start testWatch yarn start lint