-
-
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
[Doc] Migrate Badge to the new format #2489
[Doc] Migrate Badge to the new format #2489
Conversation
yes, it's better this way, but two separate PRs would have been ideal, since the changes you are going to make to this PRs are gonna have to be squashed down to the second one, even if they are related to the
I think it's better to keep the examples short for the sake of brevity. So, it's better without the return statement. But the source code will suffer from this pattern. I will have a look at your PR thanks a lot 👍 |
👍 I'm on board with writing the examples without return as well. It's not often this pattern is even applicable because you probably more often than not need to compute something from props/context first. |
@oliviertassinari I would suggest breaking down the example into 4 different examples, this is a bit complex to understand. but 4 tiny examples (each can have like less than 10 lines) is a lot more comprehensive imo. |
@subjectix I have split the examples in two. |
secondary: React.PropTypes.bool, | ||
|
||
/** | ||
* Override the inline-styles of the root element. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm proposing this standard description. I don't think that we need to say that it's for the Badge component.
I have done the same for the className
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like your approach. be sure to remind me when I make this mistake again 👍 👍
It's great. nice work 👍 merge when ready (with both commits 😬) |
@subjectix Thanks, I'm merging. |
[Doc] Migrate Badge to the new format
There is two commits here. One for converting the Badge component.
The second is for using the stateless approach for other example. However, I have added the return keyword.
I feel like it's clearer like this. Any though? @subjectix @newoga.
Maybe I should just remove this
return
keyword.