-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
I have code like this:
import React = require('react');
import ReactRouter = require('react-router');
import cbox = require('./components/commentbox')
import Route = ReactRouter.Route;
var routes = (
<Route name="app" path="/" handler={cbox.CommentBox}>
</Route>
);
React.render(
<cbox.CommentBox />,
document.getElementById('content')
);
Note that I am clearly referencing and use ReactRouter
here to create the Route
alias.
However, the code produced does not import react-router
:
define(["require", "exports", 'react', './components/commentbox'], function (require, exports, React, cbox) {
var Route = ReactRouter.Route;
var routes = (React.createElement(Route, {"name": "app", "path": "/", "handler": cbox.CommentBox}));
React.render(React.createElement(cbox.CommentBox, null), document.getElementById('content'));
});
Expected Behavior
Since ReactRouter
is referenced in the code, the react-router
lib should have been in the list of imports.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue