React: bad habitsBad habits, we all have them! In this article, I will confess some of my own coding bad habits and bad habits I have encountered in React code over the past years, working as a React dev. 1. Create derived state using a side effect This is something ...Mar 21, 2023 · 4 min readbrense.hashnode.dev
Vite dev server: adding middlewareWhile working on apps that will be deployed to Vercel, I have run into this situation several times, where I wanted to be able to start my api middleware together with the Vite dev server for local development. Normally you would run the api middlewa...Mar 20, 2023 · 2 min readbrense.hashnode.dev
Mapping Records to arraysI needed this functionality to parse a configuration regardless of whether it was supplied as an array or a Record. This function converts the Record into an array of the same type: function mapRecordToArray<T, R extends Omit<T, K>, K extends keyof T...Oct 6, 2022 · 1 min readbrense.hashnode.dev
React: What is composition, and why is it importantWhat is composition Let me demonstrate with a small example: // no composition <AlertDialog open={true} title="Don't use composition!" /> // with composition <Dialog open={true}> <Title>Use composition!</Title> <Button>Close</Button> </Dialo...Aug 30, 2022 · 3 min readbrense.hashnode.dev