react-typescript icon indicating copy to clipboard operation
react-typescript copied to clipboard

how to use without browserify?

Open cevek opened this issue 10 years ago • 2 comments

cevek avatar Sep 06 '14 14:09 cevek

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

flyon avatar Sep 07 '14 13:09 flyon

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

cevek avatar Sep 22 '14 08:09 cevek