Skip to content
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

Allow "false" prop for SimpleList toolbar, removing element #6969

Merged
merged 3 commits into from
Dec 10, 2021

Conversation

ZachSelindh
Copy link
Contributor

Because the toolbar in the SimpleFormView renders based on a logical AND operator, it is possible to remove that element by passing "false" to the toolbar prop on a SimpleForm component, for the purpose of using RA Input components wrapped in a custom form that doesn't require the traditional toolbar.

However, passing false will throw a type error:

Type 'false' is not assignable to type 'ReactElement<any, string | JSXElementConstructor> | undefined'.ts(2322)
SimpleForm.d.ts(68, 5): The expected type comes from property 'toolbar' which is declared here on type 'IntrinsicAttributes & SimpleFormProps'

This PR alters the PropTypes and interface defined Types to allow for false as a value for "toolbar."

Thank you!

@vercel vercel bot temporarily deployed to Preview – react-admin December 10, 2021 00:21 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin-storybook December 10, 2021 00:21 Inactive
Copy link
Contributor

@djhi djhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi and thanks for the PR! Can you fix the prettier related warnings?

@djhi djhi added this to the 3.19.4 milestone Dec 10, 2021
@vercel vercel bot temporarily deployed to Preview – react-admin December 10, 2021 15:09 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin-storybook December 10, 2021 15:09 Inactive
@ZachSelindh
Copy link
Contributor Author

@djhi Looks like it passes now! Thanks.

@djhi
Copy link
Contributor

djhi commented Dec 10, 2021

Thanks!

@djhi djhi merged commit bd409a5 into marmelab:master Dec 10, 2021
@ZachSelindh ZachSelindh deleted the allow-false-Simplelist-toolbar branch February 15, 2022 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants