React
Storybook JS: 'Cannot GET /'
· Reading time: ~1 minute(s) (152 words) programming web javascript storybook reactWhen you run storybook locally, you might encounter the error 'Cannot GET /' when browsing to localhost:6006. (Continue reading)
How to test a custom React hook component
· Reading time: ~3 minute(s) (624 words) programming javascript react testingAs 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.
Basic Setup for React Projects in 2020
· Reading time: ~7 minute(s) (1447 words) programming javascript reactI’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. Yes, these packages will be cached, but if you take into account the time it takes for one dev, multiply that across a team of devs (also accounting for devs trashing their local repos and re-cloning), this could be a reasonable bit of time lost. This time is often lost at times where developers are feeling most productive too.