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
[flow] Collapse theme is not an external prop #8470
Conversation
I don't follow. This is not a default property. |
It's injected by a HOC, not required for a component user to pass in. |
But the property is required for the component to work. I think that being required by the users is another topic, no? |
This is the exact pattern for flow use in the entire codebase. DefaultProps & Props == internal props. export Props represents user props only |
This is also why you see classes located in DefaultProps for example |
@rosskevin Oh, I have missed this. I'm gonna change the whole code base. At some point, we might be supporting a naked UI version of the components, without the HOCs. If we remove the HOCs from the equation, I can't think of any reason why it shouldn't be required. |
FYI - Technically, now that HOCs are correct, instead of adding classes and theme here, we could be importing types from the HOCs and intersecting them here. |
Also, before you change the pattern for naked, let me know and let's try one. In our apps, I import Props from here to build bigger components. Internally that prop is required, but externally with HOC the result should be the same. |
I have been opening #8477. |
So I'm going to merge this as-is, because the entire codebase is this way and it is not worth leaving open. We'll pick up the changes in your other PR. |
Nooo, look at the |
+| <span style="color: #31a148">theme *</span> | Object | | | |
No description provided.