This would enable me to keep consistent code styling and linting rules across all of my codebases. However for a new React project, I considered using Flow. Expo is implemented with Flow and as far I know create-react-native-app doesn’t have great TypeScript support.įor a while I wrote React projects in TypeScript, React Native projects in Flow, and everything was love and all was well. In React Native, Flow feels more natural. If you are building a React project, TypeScript is a bit more of a natural choice: it has a great integration with create-react-app and material-ui (a go-to library for UI in React apps) has first class support for TypeScript. But should you use Flow or TypeScript? The Dilemma The same level of type safety doesn’t seem to be available with other libraries. With JSX, we have a unified type system across the logic of the application, its styling, and its presentation. Every time I stumble over a bug, I ask myself: “Could this have been caught by static analysis?” Type safety is also one of the reasons why I prefer React over other frameworks such as Angular or Vue. I use types as a single source of truth between different components of my apps. I always try to put the maximum pressure on static code analysis. Strict Types: Typescript, Flow, Javascript - to be or not to be?įlow and TypeScript are both fantastic ways to limit technical debt in your JavaScript projects, allowing you to, among other things, evolve your codebase with confidence.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |