-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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] Fix Edit Toolbar docs to explain how to use a CreateButton #4544
Conversation
docs/CreateEdit.md
Outdated
@@ -883,6 +883,8 @@ Here are the props received by the `Toolbar` component when passed as the `toolb | |||
|
|||
**Tip**: To alter the form values before submitting, you should use the `handleSubmit` prop. See [Altering the Form Values before Submitting](#altering-the-form-values-before-submitting) for more information and examples. | |||
|
|||
**Tip** `<Toolbar>` will pass many props to its children, if you use `<CreateButton>` or other buttons you will get `React does not recognize the <xxx> prop on a DOM element` errors, insteade you can build you own button. |
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.
There are several things wrong in that change
<Toolbar>
will pass many props to its children
Is vague, uses future tense while we try to use present tense everywhere
if you use
<CreateButton>
or other buttons
Not true: EditButton or DeleteButton don't trigger the error
insteade
isn't English
you can build you own button
This isn't clear at all. And besides, the recommendation is rather to wrap an existing button inside another component that will just use the necessary props and drop the rest
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 have updated my PR, now it is specific and has example
Thanks. |
Couldn't this be improved in In fact this problem happens in |
#3245