-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Proposal: Use underscore for internal props #2580
Comments
To raise the discussion, another way to do it, would be to blacklist |
@oliviertassinari |
I'm agree that we could use some kind of approach for managing/differentiating/hiding internal props from others. I think hiding them from the docs is a good start, and I'm open to naming conventions as well. Like @subjectix said, if it's a truly and internal use only prop, we could technically change the name or naming convention of those props without it impacting users (or having to provide deprecation warnings). Another thought is that we might be able to use something like ES6 symbols to provide a warning or error if someone attempts to supply a value for an internal prop. I know in an other issue/pull request we mentioned there were something we'd like to do to improve the docs/codegen. Could it make sense to create an umbrella issue to cover those improvements and include hiding internal props as one of those? |
@newoga Yeah definitely, an umbrella issue to address these would be great. 👍 Any chance you got the time to compose that? I've got my hands full with the themeManager 😁 |
@subjectix No problem, I created it the issue here: #2586 |
@newoga thanks a lot 👍 |
Not now with |
@alitaheri Thanks for solving this. |
Thanks 😁 |
Since we are making the components composable, we will need some way of passing around props that are implementation details. besides the HOCs for themes will also pass down props, these props shouldn't be directly set, put rather via another internal component. Also we can filter names that start with underscore from the documentation. I think this will express the purpose of these props very well. something like
_muiTheme
instead ofmuiTheme
that can be excluded from the documentation. or many other component that have someway of communicating with their tightly coupled sister components like Toolbars.To wrap up starting the internal prop names with underscore has the following advantages:
@oliviertassinari @newoga @chrismcv @mbrookes Please give me your opinion on this.
The text was updated successfully, but these errors were encountered: