A binding layer between React and TypeScript
A binding layer between React and TypeScript for the React.createClass syntax. With React 0.13, you can use ES6 classes to inherit from React components. This works well with TypeScript and you can just use the type definitions in DefinitelyTyped. The inheritance path has some different functionality so you may still want to use the React.createClass pattern. TypedReact can help you implement that pattern by providing a dummy parent class and a set of functions to appropriately extract the prototype for React.createClass
npm install typed-react --save…In this case we export the Props and the Factory but we could make the props and state inline interfaces and just export the factory function.
TypedReact supports using existing React Mixins as well as defining new mixins with idiomatic TypeScript. The example is based on http://www.typescriptlang.org/Handbook#mixins. You need to use createMixin on your own mixins and should export that from your mixin modules.
…react.d.ts typingsextractPrototype is now createMixinReact.createClass into createClass.git clone [email protected]:Asana/typed-react.git
cd typed-react
npm install
npm run typings
npm testNo open issues yet, or sync has not completed.