Show HN: Flux and ReactJS implemented in TypeScript
1–7 of 7 posts
Re: Show HN: Flux and ReactJS implemented in TypeScript
#2Re: Show HN: Flux and ReactJS implemented in TypeScript
#3Does this actually catch any more types of bugs than vanilla JS React would? (Besides simple things that would be caught in an initial run, like not returning an element from render? Does it catch misspelled props, for instance?) It seems like a lot of increased verbosity to justify any gains.
Re: Show HN: Flux and ReactJS implemented in TypeScript
#4Does this actually catch any more types of bugs than vanilla JS React would? (Besides simple things that would be caught in an initial run, like not returning an element from render? Does it catch misspelled props, for instance?) It seems like a lot of increased verbosity to justify any gains.
Yes, the props and state are defined by interfaces so if you try to pass in a prop object which does not meet definition of the interface, typescript will complain. I think typescript is not so bad of an option until native ES6 support becomes more mainstream.
Re: Show HN: Flux and ReactJS implemented in TypeScript
#5Does this actually catch any more types of bugs than vanilla JS React would? (Besides simple things that would be caught in an initial run, like not returning an element from render? Does it catch misspelled props, for instance?) It seems like a lot of increased verbosity to justify any gains.
Yes, the props and state are defined by interfaces so if you try to pass in a prop object which does not meet definition of the interface, typescript will complain. I think typescript is not so bad of an option until native ES6 support becomes more mainstream.
Re: Show HN: Flux and ReactJS implemented in TypeScript
#6Earlier quoted context omitted.
Yes, the props and state are defined by interfaces so if you try to pass in a prop object which does not meet definition of the interface, typescript will complain. I think typescript is not so bad of an option until native ES6 support becomes more mainstream.
Btw, flow ( http://flowtype.org ) already comes with React propTypes integration. When you write `x: React.PropTypes.number.isRequired`, it knows how to correctly translate that to static types.