react-typescript
react-typescript copied to clipboard
how to use without browserify?
I've gotten this to work "without" browserify, by first using browserify to make a bundle.js file that only exports React and ReactTypescript by appending them to window.
It's a bit of a hack but it works for me now with a project where I only use reference tags to the .d.ts definition files, and --out to make 1 output file.
So I installed react-typescript as was explained here and then used the following file
'use strict';
import React = require('react/addons'); import ReactTypeScript = require('react-typescript');
//declare var require: any; declare var window: { [key: string]: any };
window['React'] = React; window['ReactTypeScript'] = ReactTypeScript;
and changed the gruntfile of this repo slightly to compile the final .js file. and then included that file in my index.html before the output of my actual app that now uses React-Typescript
I wrote hacked React wrapper which create React component object like this: React.renderComponent(new Timer({startTime: 200}), document.getElementById('test'));
https://gist.github.com/cevek/36e0546ddf001cf2801b