News for hackers. Stuff that matters.
Re:Show HN: Flux and ReactJS implemented in TypeScript by btown on Wednesday December 24, 2014 @08:36PM (#8795137)
Does 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 by mot0rola on Wednesday December 24, 2014 @08:48PM (#8795159)
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 by chenglou on Wednesday December 24, 2014 @09:52PM (#8795254)
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.
Re:Show HN: Flux and ReactJS implemented in TypeScript by mot0rola on Wednesday December 24, 2014 @10:18PM (#8795296)
flow looks cool. I just have not had time yet to give it a chance. I use typescript a lot at work and I really am digging react on the side so that is why i chose to do this. typescript is nice in that it gives you type checking plus classes, modules, lambdas etc today. I am looking forward to class support for react components (0.13?)
Re:Show HN: Flux and ReactJS implemented in TypeScript by pspeter3 on Wednesday December 24, 2014 @10:14PM (#8795285)
Agreed. I think the TypeScript integration will actually get easier when React supports native ES6 classes.