TypeScript/tests/cases/fourslash/importNameCodeFixUMDGlobalReact0.ts
Andy 8ace7b826f importFixes: Support missing "React" at a JSXOpeningElement (#16066)
* importFixes: Support missing "React" at a JSXOpeningElement

* Fix nextLineRule linting

* Rename to resolveJsxNamespaceAtLocation

* Expose getJsxNamespace and resolveNameAtLocation separately
2017-06-05 14:23:39 -07:00

29 lines
652 B
TypeScript

/// <reference path="fourslash.ts" />
// @jsx: react
// @Filename: /node_modules/@types/react/index.d.ts
////export = React;
////export as namespace React;
////declare namespace React {
//// export class Component { render(): JSX.Element | null; }
////}
////declare global {
//// namespace JSX {
//// interface Element {}
//// }
////}
// @Filename: /a.tsx
////[|import { Component } from "react";
////export class MyMap extends Component { }
////<MyMap/>;|]
goTo.file("/a.tsx");
verify.importFixAtPosition([
`import { Component } from "react";
import * as React from "react";
export class MyMap extends Component { }
<MyMap/>;`]);