Files
Main/2 Personal/1 Skills/IT/React Learnings.md
Obsidian-MBPM4 eec73cbe1b vault backup: 2025-06-12 15:09:43
Affected files:
.obsidian/workspace.json
2 Personal/1 Skills/IT/React Learnings.md
2025-06-12 15:09:43 +03:00

20 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: React Learnings
created_date: 2025-05-17
updated_date: 2025-05-17
aliases:
tags:
---
# React Learnings
## State Machine - Reducers
Reducers are what they are named after: they reduce the current state variable and an action/event into a new state and therefore are perfect for handling state machines of complex components within a react app.
The official documentation is really good: [useReducer React](https://react.dev/reference/react/useReducer) and this blog article helped me as well: [Medium](https://medium.com/better-programming/simplify-your-react-components-state-with-a-state-machine-8e9c9a4ee1f6)
Reducers are pure, so within the reducer function you never do any API calls or anything that needs to do calculations.
If you need to do any API calls or heavy calculations they must be done outside of the reducer function as explained here: [Just a moment...](https://stackoverflow.com/questions/64419132/how-to-make-api-call-in-usereducer).
## Cool Projects
- [GitHub - glowbuzzer/gbt: Glowbuzzer tools](https://github.com/glowbuzzer/gbt)
-