Babatunde Akintola’s Post

View profile for Babatunde Akintola, graphic

Frontend Engineer || Technical Writer || Learning React || Documenting my tech journey.

Day 77-80 of #100DaysOfCode Day 77 📍I learnt that useReducer can be refactored with Immer which allows for mutation of code. It is not a best practice. It is just okay to be aware that such exist. 📍Redux library is a javascript library that is quite similar to useReducer. 📍In Redux, there are many reducer functions as opposed to useReducer which has only one reducer function. 📍Redux has complex state objects. 📍 Redux Toolkit helps simplify the state and action creation process in Redux; It reduces the amount of boilerplate codes to write. 📝A more significant part of useReducer and Redux is the dispatch function. Dispatch function helps to easily track changes in states. Day 78 To access state in Redux: 📍Find the component that needs to access some state; 📍Import the 'useSelector' from react-redux; 📍Call the hook, passing in a selector function; 📍Use the state. Anytime state changes, the component will re-render. Day 79 📍Learnt how to do manual action creation in Redux 📍Understood file organisations (organising files/folders either by feature or by function) 📝Redux docs recommend feature approach which doesn't work well with Redux-Toolkit. Day 80 I was able to implement organising folders and files by features such as: 📍Components & 📍Store, where we have: 👉songsSlices & 👉moviesSlices, as files 📍action.js where createAction was imported and manual action was created. #connect #reactjs

  • No alternative text description for this image

Way to go, Babatunde Akintola! Your determination knows no bounds! Your progress speak volumes about your character and drive. Keep pushing forward and always remember that you have the power to achieve anything you set your mind to! We're rooting for you! 🌟👊

To view or add a comment, sign in

Explore topics