question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve documentation about when the setting of property "muiName" is really necessary

See original GitHub issue

Question and feature request:

In the documentation for v0.19.0 there are some examples, e.g. for AppBar, where the property muiName is set. In most of the other examples in the documentation this property is not set. In the documentation for v1.0.0-beta.7 it reads

[…] we tag some of our components when needed with a muiName static property.

My question would be, what is meant by “when needed”? Most examples don’t set muiName, although they all define React subcomponents and wrap Material-UI components in one way or another. Also see my initial question on stackoverflow.

Could you please elaborate further on when and how to use muiName in the documentation and maybe also update the component examples, in case setting of muiName is missing anywhere due to sloppiness.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
oliviertassinaricommented, Sep 1, 2017

I am a newbie with MUI

Don’t worry, this is an advanced feature. You don’t need to worry about it until you face the issue.

If I knew the answer to that question, I wouldn’t have opened this issue.

The React tree structure is essential to understand the why around the muiName existence. Let’s say we have the following.

<Parent>
  <Icon />
  <Text />
</Parent>

The Parent wants to apply a color property to only the Icon children, but he can also have a Text children. How does he know which children are how? He uses the muiName.

Again, at the end of the day, every component is “wrapped” by another component in the React tree.

I would rather use the composition wording over the wrap one. We refer to wrap at the component level, not the element one.

I hope it’s more clear this way. Sorry I couldn’t go into more details. You can find a better channel than Material-UI issues to learn more about React 😃.

0reactions
svdHerocommented, Sep 4, 2017

Thank you for clarifying further Olivier.

You don’t need to worry about it until you face the issue.

That’s fine. How would you I notice if the issue becomes important for me? Would there be warnings in my browser’s javascript console? Or would there just be styling issues?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Improve documentation about when the setting of property ...
My question would be, what is meant by "when needed"? Most examples don't set muiName , although they all define React subcomponents and...
Read more >
What is the muiName property and when do I have to set it for ...
Answer in documentation is: In order to provide the maximum flexibility and performance, we need a way to know the nature of the...
Read more >
Composition - Material UI - MUI
To solve this problem, we tag some of the components with a muiName static property when needed. You may, however, need to wrap...
Read more >
material-ui/core/CHANGELOG.md - UNPKG
- ⚛️ A first step toward converting all the demos to React Hooks (#13873) @adeelibr. 124, - And many more bug fixes and...
Read more >
@mui/icons-material | Yarn - Package Manager
Important : This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found