react

How to test a custom React hook component

· Reading time: ~3 minute(s) (624 words) programming javascript react testing

As part of my GameBrowser side-project, I’m at the stage where I wanted to start improving the UI a bit. This included needing to define a way of filtering the servers in the list, because they’re all saved together at the moment. As a first attempt, I opted for a simple Dropdown control and decided to make it generic using a custom React Hook. The result was the creation of useDropdown. (Continue reading)

Basic Setup for React Projects in 2020

· Reading time: ~7 minute(s) (1447 words) programming javascript react

I’ve seen a lot of people using project initialisation tools to create their new React projects over the years, in particular create-react-app. While I do see there are some benefits to these tools (in particular for newcomers), these tools do have their disadvantages. I cloned a repository the other day which was using create-react-app, and an npm i installed over 2000 packages! This is a hell of a lot to download just to be able to run some code locally. (Continue reading)