- React.ts using
Vite
- react-router-dom
- bootstrap, react-bootstrap for styling
- Apart from setting up the alias in tsconfig.json, we need to add a property
resolve.alias
to vite.config.ts.
- The nested route structure can be seen here.
- In our case, single Note Page(both show & edit page) have a common layout.
- In the common layout, we refer to actual route using
Outlet
component. - To pass any data in it we use a prop called context.
- To access the context passed in parent(common) layout, we use a hook called
useOutletContext
.