Working with useState Redux toolkit
Basic useState example. The initoal value (20) was passed from the server but the component itself (Counter application) was created from the client side.
Basic Redux example. The initial value (20) was passed from server The initial value (100) was retrieved from an endpoint (rest api) from an asyncThunk function call; once retrieved, state is sets with that value.
What I've learned:
- Redux toolkit
- Route handlers
- Since NextJS 13, all components are Server Components. 'use client' is mandatory in order to work with React hooks