react-einfach
Write high performance React code for beginners
As you know, that there are quite a lot of pitfalls in React, unless you have much expertise. For instance, to avoid unnecessary re-render operations, to write component with shorter code.
This library aims to make sure even shitty code does not matter.
Set state with dirty check
React v16.8 introduced Hooks. It helps to write a much shorter variant of
React.Component
with functional components. However, in some case, you might set state
with a object copy, but it triggers re-rendering of child (none pure) component.
The helper function withDirtyCheck
give you a no-brain option to avoid this from
happening!
Example:
const formObject setFormObject = React // will update state object const formObject2 setFormObjectIfDirty = // will NOT update state object