TypeScript Version: 2.2.0-dev.20170125
Code (compiler test case)
//@module: es6
//@moduleResolution: node
//@target: es6
//@noImplicitAny: false
//@allowSyntheticDefaultImports: true
//@allowJs: true
//@jsx: react
//@outDir: "build"
//@filename: react.d.ts
export = React;
export as namespace React;
declare namespace React {
function createClass(spec: any): ClassicComponentClass;
interface ClassicComponentClass {
new (props?: any): ClassicComponentClass;
}
}
declare global {
namespace JSX {
interface ElementAttributesProperty { }
}
}
//@filename: src/components/TabBar.js
export default React.createClass({
render() {
return (
null
);
}
});
//@filename: src/modules/navigation/NavigationView.js
import TabBar from '../../components/TabBar';
import {layout} from '../../utils/theme';
const x = <TabBar height={layout.footerHeight} />;
Expected behavior:
NavigationView.js should look like:
import TabBar from '../../components/TabBar';
import {layout} from '../../utils/theme';
const x = React.createElement(TabBar, { height: layout.footerHeight });
Actual behavior:
The layout import disappears and we are left with:
import TabBar from '../../components/TabBar';
const x = React.createElement(TabBar, { height: layout.footerHeight });
Took me a long time to develop this test case. Not sure if it's totally minimal, but hope it helps :)
TypeScript Version: 2.2.0-dev.20170125
Code (compiler test case)
Expected behavior:
NavigationView.js should look like:
Actual behavior:
The
layoutimport disappears and we are left with:Took me a long time to develop this test case. Not sure if it's totally minimal, but hope it helps :)