Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

For SFCs a triple slash directive should be used instead of the react import #469

Closed
unstubbable opened this issue Jan 19, 2018 · 0 comments · Fixed by #472
Closed

For SFCs a triple slash directive should be used instead of the react import #469

unstubbable opened this issue Jan 19, 2018 · 0 comments · Fixed by #472
Assignees

Comments

@unstubbable
Copy link
Collaborator

For a component such as:

// foo.jsx
import * as React from 'react';

export const Foo = () => <div />;

tsc generates this declaration file:

// foo.d.ts
/// <reference types="react" />
export declare const Foo: () => JSX.Element;

Therefore I think we should switch from import 'react'; to /// <reference types="react" /> in the case where no class component is exported.

Depends on RyanCavanaugh/dts-dom#39.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant