Add $ to columnCount prop used by styled component#2992
Conversation
|
|
||
| type TableContainerProps = { | ||
| columnCount: number; | ||
| $columnCount: number; |
There was a problem hiding this comment.
See https://styled-components.com/docs/basics#attaching-additional-props for docs on props for styled components.
koesie10
left a comment
There was a problem hiding this comment.
Thanks, I didn't know about this feature. Apparently, these are transient props. I think it's fine to use these when we're only using the prop in the same file, but for components that are used outside of the same file, we should probably not use those. That way we can keep the implementation separate from the exposed interface.
|
Interesting. Thanks for finding that documentation on transient props. I didn't know that's how they worked. We do have some other examples in the codebase like which aren't generating this error, but my guess is either becausesize is lowercase, or because size is an allowed DOM attribute, however it's not an attribute that does anything on a button. I found and inspected this element to see if it would have a size="x-small" just sitting there in the DOM, but surprisingly it didn't. 😕
We could look at also addressing those cases if that's helpful, or just leave them. |
I'll merge this one now since it's making a warning pop up. I'll open an issue to look at the others and see if we do or don't want to do anything there. |
This stops the following error from appearing during tests:

I'm not totally sure if this has an effect on behaviour in production. Perhaps it was working but just with a warning.
Checklist
ready-for-doc-reviewlabel there.