Type-Driven Development – Replacing Unit Tests with Types in Typescript

Being explicit about the return type of the function is the most under-utilized feature of TypeScript. At least, that’s true for the way I write my code. When I first started using TypeScript, I was really impressed with the way it inferred the return type of the function, and having these types perpetuate throughout the […]

Styling Custom Components in React Native Using TypeScript

I recently ran into an issue with providing style properties to custom React Native components written in TypeScript. When defining the type of the style property, we were using the ViewStyle and TextStyle types provided by React Native. interface Props { textStyle?: TextStyle; viewStyle?: ViewStyle; } class BlogPost extends React.PureComponent<Props> { render() { return ( <View […]