Month: June 2023
-
Alternative to running useEffect once
This is an alternative to running useEffect without any parameters.
-
React: Cloning elements with React.cloneElement()
Use this to copy elements and give them different props or add new ones. We have a Button which accepts the props textColor and backgroundColor. Then we have ButtonContainer which clones it’s children (in this case Button) but we can give it new props to create variations.