📄️ Absolute path in Vite
Add this to vite.config.ts. This allow you to use absolute path such as import DataViewer from "@components/DataViewer/DataViewer";.
📄️ data-fetching-with-useeffect
Data fetching with useEffect
📄️ Handle click outside of element
The type for event is MouseEvent and do as Node when using the parameter event.target.
📄️ React Snippets
Components
📄️ Tips and tricks
Use spread operator to add an element to an array
📄️ Typescript for React
Conventional props
📄️ Zustand
- In the component, you don't necessarily have to call the whole state, you can create a smaller get function to get the latest state. For example: