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 […]

Experiments in Purely Functional TypeScript

Recently, I’ve been experimenting with using functional programming in my side projects. Today, I want to share some of what I’ve learned, focusing on utilities I’ve created to facilitate purely functional TypeScript programming. Different Ways to Define Similar Functions Here are three versions of *roughly* the same function: const doubleAll = (array: number[]) => { […]

Flavoring: Flexible Nominal Typing for TypeScript

Recently, we’ve been making heavy use of TypeScript at Atomic Object. We love the great tooling and instant feedback we get with the language’s powerful type system. TypeScript’s structural type system gives us a lot of powerful tools for making invalid states unrepresentable, thereby pointing out bugs at compile time instead of runtime. However, one […]