mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
30 lines
850 B
TypeScript
30 lines
850 B
TypeScript
//// [tests/cases/conformance/jsx/tsxExternalModuleEmit2.tsx] ////
|
|
|
|
//// [modules.d.ts]
|
|
declare module 'mod' {
|
|
var y: any;
|
|
export default y;
|
|
}
|
|
|
|
//// [app.tsx]
|
|
import Main from 'mod';
|
|
declare var Foo, React;
|
|
// Should see mod_1['default'] in emit here
|
|
<Foo handler={Main}></Foo>;
|
|
// Should see mod_1['default'] in emit here
|
|
<Foo {...Main}></Foo>;
|
|
|
|
|
|
|
|
//// [app.js]
|
|
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const mod_1 = __importDefault(require("mod"));
|
|
// Should see mod_1['default'] in emit here
|
|
React.createElement(Foo, { handler: mod_1.default });
|
|
// Should see mod_1['default'] in emit here
|
|
React.createElement(Foo, Object.assign({}, mod_1.default));
|