Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Another prop-types lib solution #359

Merged
merged 1 commit into from
Apr 15, 2017

Conversation

conceptualitis
Copy link
Contributor

@conceptualitis conceptualitis commented Apr 13, 2017

I goofed up and totally missed that @tkh44 (#352) and @DonnieWest (#351) were already working on this when I started looking at #358.

The big differences here are

  • updating the error message to match what prop-types spits out
  • changing the variables names from Foo in the test, which had to be done because somewhere in the code the I think FB guards against spitting out the same console.error message multiple times. Meaning the variable names have to be different.

Let me know what you all think.

@@ -82,7 +82,7 @@
"immutability-helper": "^2.1.2",
"preact-render-to-string": "^3.6.0",
"preact-transition-group": "^1.1.0",
"proptypes": "^0.14.3",
"prop-types": "^15.5.8",
Copy link
Member

Choose a reason for hiding this comment

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

Thought: maybe this should be a peer dependency now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Up to you, but the prop-types docs recommends leaving it here ¯_(ツ)_/¯

https://github.com/reactjs/prop-types/#how-to-depend-on-this-package

if (err) console.error(new Error(err.message || err));
}
}
PropTypes.checkPropTypes(propTypes, props, 'prop', displayName);
Copy link
Member

Choose a reason for hiding this comment

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

Ah - this is how they want us to validate! That makes more sense.

@developit
Copy link
Member

@DonnieWest @conceptualitis - which PR do you guys think we should merge? The implementation appears to be roughly the same between the two, mainly tests differing.

@developit
Copy link
Member

I'll merge this for now, but there's also documentation in @DonnieWest's PR we'll want too.

@developit developit merged commit 5198522 into preactjs:master Apr 15, 2017
tkh44 pushed a commit to tkh44/preact-compat that referenced this pull request Apr 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants