React.js
Quick notes
Functional components
JSX is a syntax extension while React is a JavaScript library.
Props
ComponanteName.defaultprops
ComponentName.propTypes
State
defaultprops
React hooks
useState: Returns a stateful value and a function to update it
useEffect: Perform side effects in function components
useContext:
useReducer:
useRef:
useMemo:
contextAPI
redux
React dev tools extension
TypeScript
Lifting up the state
In react there are three types of inputs that can be read while rendering: props, state, and context.
local mutation inside pure functions is alright.
In react side effects usually inside event handlers.
useEffect should be last resort.
Last updated