Javascript – loop efficiency

I want to run through a scenario that highlights how loop performance can be very poor…when poorly considered, and you might not realise it if the code “works”. Consider this scenario – the database has a table of 30,000 bookings for a collection of tennis courts, for each booking there is a startDate and an… Continue reading Javascript – loop efficiency

Published
Categorized as Javascript

Javascript – hoisting

Recently I had to refactor a very large react class component into a function component, the overall goal was to keep the business logic the same, but add thourough typing so the risk of regressions from a much larger refactor later would be lower. I ran into a problem with this, it seemed at first… Continue reading Javascript – hoisting

React Testing Lib – don’t misuse act

After reading this article you should checkout other common mistakes using RTL here: https://kentcdodds.com/blog/common-mistakes-with-react-testing-library Ever noticed this warning in your tests? Noise like this in test runs can be really annoying, and if we read the error in a bid to find out how we might get rid of it, we might think – well… Continue reading React Testing Lib – don’t misuse act

React – consider styled components

Instead of having css (or equivalent) files, considering having styled components. There is serious value to taking this approach as it results in a much more contextualised styling system. Let us first take the following example that does not leverage this approach: In file SomeComponent.tsx in file styles.css notice that these two units of code… Continue reading React – consider styled components

Published
Categorized as React