5 ms·
Awesome job! QQ- why declare typing in both flow and proptypes? Thanks!
by marklmc 9y ago
Awesome job!
QQ- why declare typing in both flow and proptypes? Thanks!
- concerned_user 9y agoBecause proptypes actually catch stuff during runtime, flow not so much. Maybe I have a wrong setup, but that is the case for me.
- aviraldg 9y agoThere's a Babel plugin that transforms your code to do runtime typechecks based on your Flow type annotations: https://codemix.github.io/flow-runtime https://codemix.github.io/flow-runtime
- markl42 9y agoIf you already have static type checking, is that not enough? Are there scenarios where proptypes will throw/show warnings at runtime that flow wasn't able to catch at build time?
- chrislloyd 9y agoSame as what other commenters have suggested, both runtime and compile time checks are useful. We'd like to consolidate around Flow (our docs specify flow types) but just haven't gotten around to adding/vetting that Babel plugin (or alternatives). I'd personally like to just use static types but it would mean that all users would have to use Flow + our specific version of Flow.