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 propTypes warning #133

Merged
merged 1 commit into from
Feb 11, 2022
Merged

Fix propTypes warning #133

merged 1 commit into from
Feb 11, 2022

Conversation

phou-patreon
Copy link
Contributor

Currently, we copy all the properties of the wrapped component when wrapping it with nion, including propTypes. This causes situations where the wrapped component (correctly) declares that it requires the nion prop and this gets propagated to the connected component as well, which should not require the nion prop since it injects it to its child.

This PR fixes this issue by stripping the nion propType, if it exists, from the connected component.

@phou-patreon phou-patreon requested review from jbyttow and a team February 10, 2022 19:09
@@ -114,7 +114,8 @@
],
"testMatch": [
"**/src/**/__tests__/**/*.[jt]s?(x)",
"**/src/**/?(*.)+(spec|test).[jt]s?(x)"
"**/src/**/?(*.)+(spec|test).[jt]s?(x)",
"**/test/**?(*.)+(spec|test).[jt]s?(x)"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mind if we stick with the __tests__ pattern? It's a Jest standard, and the underscores make it easier to visually scan the folder structure when looking for files

Copy link
Contributor Author

@phou-patreon phou-patreon Feb 10, 2022

Choose a reason for hiding this comment

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

I added this because the existing integration tests live in the test folder and weren't being run.

Probably would just be better to do a complete pass and rename all folders named test as a followup, yeah? I can submit a followup PR if so.

Copy link
Contributor

Choose a reason for hiding this comment

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

ohh, that's crazy, i didn't know about the /test/!

@phou-patreon phou-patreon merged commit f63b470 into master Feb 11, 2022
@beberry beberry deleted the proptypes branch February 15, 2022 19:23
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.

3 participants