-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Description
π Search Terms
Declaration merging, isolatedModule, type import conflict
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about declaration merging
β― Playground Link
π» Code
import type { Component } from 'react'; // TS errors on this while it is imported as a type
const Component: Component | null = null;
import type { FC } from 'react'; // TS allows this as it's a type
const FC: FC | null = null;
π Actual behavior
TypeScript reports the following error:
Import declaration conflicts with local declaration of Component.
π Expected behavior
Because Component
is imported as a type, it should be merged with the variable Component
without emitting an error.
Additional information about the issue
A related issue was recently fixed and discussed in a design meeting.
Fixing the current issue could make TypeScript behavior more consistent.
Metadata
Metadata
Assignees
Labels
No labels