this is my ts code:
import AddToCartBtn from "./AddToCartBtn";
import * as React from "react";
import * as ReactDOM from "react-dom";
declare var document:Document;
var _handler : __React.MouseEventHandler;
ReactDOM.render(<AddToCartBtn clickHandler={_handler}></AddToCartBtn>, document.getElementById("bd"));
and compile to js like:
define(["require", "exports", "./AddToCartBtn", "react", "react-dom"], function (require, exports, AddToCartBtn_1, React, ReactDOM) {
var _handler;
ReactDOM.render(React.createElement(AddToCartBtn_1.default, {"clickHandler": _handler}), document.getElementById("bd"));
});
it is a define function and doesn't work. how do I get a require function?