I am encountering an issue with my TypeScript code. Here is a snippet from Project.ts
:
import type { SomeType } from '../../types/Project';
// import { SomeType } from '../../types/Project'; tried this too
const SomeType = ({ s }: { s: SomeType }): JSX.Element => {
return <>${s}</>;
};
Additionally, in the same file, I have:
export type SomeType = JSX.Element;
Even though I thought types and variables could coexist with the same name, the TS linter does not show any warnings but throws an error:
Identifier 'SomeType' has already been declared.
This has left me puzzled. Any ideas why this might be happening?
You can view this example on CodeSandbox: https://codesandbox.io/s/objective-glade-y94j58?file=/src/App.tsx