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

[prop-types] add elementType and resetWarningCache #33244

Merged
merged 1 commit into from Feb 28, 2019

Conversation

eps1lon
Copy link
Collaborator

@eps1lon eps1lon commented Feb 20, 2019

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

If changing an existing definition:

@eps1lon
Copy link
Collaborator Author

eps1lon commented Feb 20, 2019

I did look into the react-jss since I'm familiar with the package and the fail looked like it was related: Don't think it actually is. Error occurred on master to and was fixable with

diff --git a/types/react-jss/react-jss-tests.tsx b/types/react-jss/react-jss-tests.tsx
index 5fe76ae1..cfcad4cd 100644
--- a/types/react-jss/react-jss-tests.tsx
+++ b/types/react-jss/react-jss-tests.tsx
@@ -27,9 +27,9 @@ interface ButtonProps {
   active?: boolean;
 }
 
-const styles = (theme: MyTheme) => createStyles({
+const styles = (theme: MyTheme) => createStyles<ButtonProps>({
   myButton: {
-    color: (props: ButtonProps) => props.active ? 'red' : theme.color.primary,
+    color: props => props.active ? 'red' : theme.color.primary,
     margin: 1,
     "& span": {
       fontWeight: "revert"

@typescript-bot typescript-bot added this to Waiting for Reviewers in Pull Request Status Board Feb 20, 2019
@typescript-bot typescript-bot added the Popular package This PR affects a popular package (as counted by NPM download counts). label Feb 20, 2019
@typescript-bot
Copy link
Contributor

typescript-bot commented Feb 20, 2019

@eps1lon Thank you for submitting this PR!

🔔 @DovydasNavickas @ferdaber - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

@typescript-bot
Copy link
Contributor

typescript-bot commented Feb 21, 2019

@eps1lon The Travis CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@ferdaber
Copy link
Contributor

Can you add a test for the exotic components like React.Fragment and React.lazy()?

@eps1lon
Copy link
Collaborator Author

eps1lon commented Feb 21, 2019

Can you add a test for the exotic components like React.Fragment and React.lazy()?

@ferdaber How would this look like? As far as I know I can't expect a specific type in the typescript interface and then validate a less specific type in propTypes. In this case I can't declare component?: LazyExoticComponent in the interface and the use component: elementType.

@ferdaber
Copy link
Contributor

I meant a test that those components, when passed in as props, passes the JSX.LibraryManagedAttributes check. I should clarify: I was talking about React types tests not PropTypes types tests 😅

They're tightly coupled so changes to this package almost necessarily needs a retest of the library-managed-attributes.ts test file in @types/react.

@eps1lon
Copy link
Collaborator Author

eps1lon commented Feb 21, 2019

@ferdaber the managedAttributes.tsx tests are completely commented out though. I really have no idea what tests I should add.

Copy link
Contributor

@ferdaber ferdaber left a comment

Choose a reason for hiding this comment

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

I don't want this change to be blocked because of tests so I'll go ahead and approve.

@typescript-bot typescript-bot added the Owner Approved A listed owner of this package signed off on the pull request. label Feb 22, 2019
@typescript-bot typescript-bot moved this from Needs Author Attention to Check and Merge in Pull Request Status Board Feb 26, 2019
@typescript-bot
Copy link
Contributor

A definition owner has approved this PR ⭐️. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped!

@jessetrinity jessetrinity merged commit 628119b into DefinitelyTyped:master Feb 28, 2019
@typescript-bot
Copy link
Contributor

I just published @types/prop-types@15.7.0 to npm.

@typescript-bot typescript-bot removed this from Check and Merge in Pull Request Status Board Feb 28, 2019
@eps1lon eps1lon deleted the feat/prop-types/15.7 branch September 18, 2019 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Owner Approved A listed owner of this package signed off on the pull request. Popular package This PR affects a popular package (as counted by NPM download counts).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants