Improving myself in the world of React hooks

Tony Vu
1 min readFeb 18, 2021

Finally, my PR on creating a hook to persist user’s preferred theme choice has come in order with the help of professor Dave. On a personal level, this has been a good challenge for me because I was not very familiar with custom hooks and I found it difficult to implement the logic I have due to my lack of knowledge in what to use and what not. Professor Dave simplified the whole process with the use of react-use library. The library basically includes utility hook that can be used to speed up development time. In this case, useLocalStorage has been used since our goal is to persist user’s theme choice in local storage.

This is definitely a cleaner way vs my previous approach of having portion of code run on client only. As I am still learning about NextJS, this is something to keep in mind for future. Next on my list, I will try to work on the feed discovery microservice that I have got a good idea how to start. I just need to implement it now. And hope I have the energy to do it sooner rather than later…:)

--

--