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

react: Fix test failure from merge conflict. #38603

Merged
merged 1 commit into from Sep 25, 2019

Conversation

sandersn
Copy link
Contributor

A test written in #38337 on 12 Sep was merged on 24 Sep. In between in #38352, the Props definition it used changed so that the new test was an error.

This PR just clones the original Props type and gives it a new name. This fixes the error.

A test written on 12 Sep was merged on 24 Sep. In between, the Props
definition it used changed so that the new test was an error.

This PR just clones the original Props type and gives it a new name.
@sandersn sandersn changed the title Update test failure from merge conflict. react: Fix test failure from merge conflict. Sep 25, 2019
@typescript-bot typescript-bot added this to Check and Merge in Pull Request Status Board Sep 25, 2019
@typescript-bot typescript-bot added 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). Merge:Express labels Sep 25, 2019
@typescript-bot
Copy link
Contributor

typescript-bot commented Sep 25, 2019

@sandersn Thank you for submitting this PR!

🔔 @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @DovydasNavickas @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @Hotell @franklixuefei @Jessidhia @saranshkataria @lukyth @eps1lon - 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

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!

@@ -402,7 +402,13 @@ const ForwardingRefComponent = React.forwardRef((props: {}, ref: React.Ref<RefCo
return React.createElement(RefComponent, { ref });
});

const ForwardingRefComponentPropTypes: React.WeakValidationMap<Props> = {};
interface AttributeProps extends React.Attributes {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
interface AttributeProps extends React.Attributes {
interface AttributeProps {

React.Attributes is not meant to be used that way since it includes props that you never see inside your component or need to validate with propTypes. It's technically only a private type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test is broken without extends React.Attributes -- WeakValidationMap<AttributeProps> doesn't have any properties in common with WeakValidationMap<RefAttributes<RefComponent>> from ForwardRefExoticComponent<RefAttributes<RefComponent>>

Does that mean the test is broken or the new propTypes property in ForwardRefExoticComponent is wrong? I suppose I could say

const ForwardingRefComponentPropTypes: React.WeakValidationMap<React.RefAttributes<RefComponent>> = {};

in the test instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know React that well, I'm just trying to get it unblocked for other contributors, so any advice you have is helpful.

Copy link
Collaborator

@eps1lon eps1lon Sep 25, 2019

Choose a reason for hiding this comment

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

Well lets merge this if this blocks other work. I'll take look later why we need this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I merged it.

@rpokorny Maybe you can take another look too?

@typescript-bot typescript-bot moved this from Check and Merge to Needs Author Attention in Pull Request Status Board Sep 25, 2019
@typescript-bot typescript-bot added Revision needed This PR needs code changes before it can be merged. and removed Owner Approved A listed owner of this package signed off on the pull request. Merge:Express labels Sep 25, 2019
@typescript-bot
Copy link
Contributor

@sandersn One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits or comments. Thank you!

@sandersn sandersn merged commit ad9de86 into master Sep 25, 2019
Pull Request Status Board automation moved this from Needs Author Attention to Done Sep 25, 2019
@elibarzilay elibarzilay deleted the fix-react-test-merge-conflict branch November 28, 2020 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Popular package This PR affects a popular package (as counted by NPM download counts). Revision needed This PR needs code changes before it can be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants