You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spreading objects without typings doesn't break things.
Actual behavior:
Unexpected breakage.
Note that I'm using any here as an example; we've seen this happening in places where the object is of type React.HTMLProps<HTMLDivElement> and we don't understand. We've seen a number of errors from 2.3.2 where the compiler is complaining about spreading objects in JSX that are definitely objects of some interface shape but TypeScript isn't recognizing them.
The text was updated successfully, but these errors were encountered:
Looks like a dupe of #15478, but in this case imports are being stripped. Feel free to close and track there, if this is the same. It's important to fix asap.
This is caused by the same underlying issue as #15469. it should be fixed by #15548. The fix should be available in typescript@next tomorrow (5/4), please give it a try and let us know if you are still seeing issues.
TypeScript Version: 2.3.2 (also repros in 2.3.1, but not 2.2.1)
Code
We're seeing problems with spreading objects that aren't typed correctly.
This works, notice that
styles
has a type of empty object:The output generated successfully requires the
styling
package stored in thestyling_1
variable:However, if the
styles
object is of type any, thestyling_1
variable disappears, and causes nastiness downstream.Typescript:
Generated JavaScript, where did
styling_1
go?Expected behavior:
Spreading objects without typings doesn't break things.
Actual behavior:
Unexpected breakage.
Note that I'm using
any
here as an example; we've seen this happening in places where the object is of typeReact.HTMLProps<HTMLDivElement>
and we don't understand. We've seen a number of errors from 2.3.2 where the compiler is complaining about spreading objects in JSX that are definitely objects of some interface shape but TypeScript isn't recognizing them.The text was updated successfully, but these errors were encountered: