This is how you can force TypeScript to always have at least one item in an array. Or in other words: to not allow empty arrays. You can also force it to have at least 2, 3 etc. items: This came in handy lately when I was implementing a ColorSelection component in React: Having it […]

Create an NX workspace for a new project using myorg as the workspace name. The workspace name will be used as a prefix when creating libraries later such as @myorg/mylib. You will be asked a couple of questions such as choosing a preset (React, Next, react-express, angular, empty and more) and a CLI. Alternatively you […]

Cloud Firestore is a cloud-hosted, NoSQL database that your iOS, Android, and web apps can access directly via native SDKs. Initialize Cloud Firestore Get Firebase configuration from web console and then use it to initialize the app in your web frontend: A collection contains documents and nothing else. Documents contain data as property-value pairs. The […]

Installing recoil Add RecoilRoot to your root component Atoms An atom is (a piece) of state that can shared between your components is what components can use to read from or write to will trigger a re-render for any component (that uses the atom) whenever the atom state changed You create atom shared state like […]

Installing TypeScript Choose one of these This will allow you to run tsc command. To test whether a TypeScript file compiles you create one: and then run tsc index.ts. You end up with an error: The reason is that name property is already defined on the window object (global scope), so you either have to […]

We are going to have a look at how you can test your React Components and your Redux reducers and actions.