-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TSX spread stopped working #14112
Comments
@normalser it is related to #13557 as now spread operation in Jsx is going through same logic as normal spread (previously it is handled separately... I will discuss with @sandersn who is working in this area |
In #13288, @normalser @yuit @RyanCavanaugh opinions from people who actually know React? |
Note that this would make error reporting a lot harder (impossible?) for the case that the intersection does contain a type parameter. |
Well, it turns out that the culprit is that |
JSX spread is very common; this needs to work for a major release |
Fix is up at #14122 |
Is there a workaround for folks wanting to use ts 2.3 with spread types? It seems like the common react pattern of spreading class Component<T extends object> extends React.Component<T, {}> {
render() { return <div { ...this.props }></div>; }
} compiler output: ERROR in ./file.tsx
(34,17): error TS2698: Spread types may only be created from object types. |
@stephen we are going to take a look about this and see what we can do. We have this PR (https://github.com/Microsoft/TypeScript/pull/13288/files) for normal spread which we will want to get in and apply for React Update we have lifted up the restriction.... The fix is in tonight nightly. we will also ship this for 2.3.3 |
Was working fine until:
[email protected]
In
[email protected]
throws:error TS2698: Spread types may only be created from object types.
Not sure if related: #13557
The text was updated successfully, but these errors were encountered: