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

fix: resolve PropType warning for indeterminate prop in DataTable #812

Merged

Conversation

adamstankiewicz
Copy link
Member

Resolves the following prop type warning regarding indeterminate checkboxes in the DataTable component.

image

@coveralls
Copy link

coveralls commented Sep 14, 2021

Coverage Status

Coverage increased (+0.04%) to 87.611% when pulling b1d9062 on astankiewicz/fix-prop-type-warning-indeterminate into 91c7a50 on master.

@adamstankiewicz adamstankiewicz changed the title fix: resolve warning for indeterminate prop in DataTable fix: resolve PropType warning for indeterminate prop in DataTable Sep 14, 2021
const updatedProps = useMemo(
() => {
const newProps = { ...props };
newProps.isIndeterminate = newProps.indeterminate;
Copy link
Contributor

Choose a reason for hiding this comment

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

is reason why not use: { ...props, isIndeterminate: props.indeterminate }?

Copy link
Member Author

Choose a reason for hiding this comment

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

It'd have to be written as the following, such that indeterminate is no longer part of props, but yes... this is likely cleaner:

const { indeterminate, ...rest } = props;
const newProps = { ...rest, isIndeterminate: indeterminate };
return newProps;

Copy link
Contributor

@muselesscreator muselesscreator left a comment

Choose a reason for hiding this comment

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

LGTM

@adamstankiewicz adamstankiewicz merged commit 8bcd896 into master Sep 14, 2021
@adamstankiewicz adamstankiewicz deleted the astankiewicz/fix-prop-type-warning-indeterminate branch September 14, 2021 18:50
@edx-semantic-release
Copy link
Contributor

🎉 This PR is included in version 16.13.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants