-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Design LimitationConstraints of the existing architecture prevent this from being fixedConstraints of the existing architecture prevent this from being fixed
Description
TypeScript Version: 2.2.2 & 2.3.2
Code
// Basic example
const paramArray = <T>(param1: T, param2: T) => [param1, param2];
// React specific example
type Component<T> = React.ComponentClass<T> | React.StatelessComponent<T>;
const decorator = <T>(Component: Component<T>) : Component<T> => (props) => <Component {...props} />
Expected behavior:
Both examples should work in a .tsx
file in addition to the basic example working in a .ts
file.
Actual behavior:
The usage of <T>
prior to the function braces causes a JSX error within .tsx
files: "JSX element has no corresponding closing tag.". Basic example works as expected in a .ts
file.
Specifying an unused type variable seems to be a workaround to avoid the error:
const paramArray = <T1, T2>(param1: T1, param2: T1) => [param1, param2];
Rudxainelhay-avihezer, pixels-farm, kenobi-io, Inspirateur, SaadBazaz and 7 more
Metadata
Metadata
Assignees
Labels
Design LimitationConstraints of the existing architecture prevent this from being fixedConstraints of the existing architecture prevent this from being fixed