-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Ok, I figure out. I had to use |
Beta Was this translation helpful? Give feedback.
-
Yeah, OK I thought you might say something like It follows my initial hunch, which is we effectively highjack a few global HTML attributes such as For other components we either try and extend the typings of the closest related HTML element that is going to be rendered, or for some older components like For components where we extending the typings on the HTML element, we aren't removing the highjacked attributes. Typescript believes they are valid HTML attributes (which is correct, they are) but the rest of the system has trained you to believe they are styling props. They are rightly, not working as we intend them to be, but the somewhat naive extension of HTML element typings is causing you confusion. We'll add a ticket to look to tightening this up. |
Beta Was this translation helpful? Give feedback.
Yeah, OK I thought you might say something like
Truncate
.It follows my initial hunch, which is we effectively highjack a few global HTML attributes such as
width
,height
andsize
and convert them to styling props. This works really well on the Styling primitives.For other components we either try and extend the typings of the closest related HTML element that is going to be rendered, or for some older components like
Truncate
which are just styled components, we get the typings from Emotion for the HTMl element. Which I believe is where the confusion starts raising its head.For components where we extending the typings on the HTML element, we aren't removing the highjacked attributes. …