Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Fix errors caused by demo payment methods #1547

Merged
merged 1 commit into from
Jan 13, 2020

Conversation

nerrad
Copy link
Contributor

@nerrad nerrad commented Jan 10, 2020

This was introduced in #1349 . The way the demo payment method registration was setup, the react nodes were root native dom elements (<div>, <img />) so when React.cloneElement was called on them to pass in the checkout props, these props were then applied to the native nodes which in turn caused the React warnings due to camel-case props (isActive, checkoutData etc). The solution was to modify the demo elements so that they were custom react nodes (which is what actual payment methods will be doing anyways).

To Test

View the console for the checkout block in the editor or on the frontend and there should be no warnings in the console.

@nerrad nerrad requested a review from a team January 10, 2020 21:20
@nerrad nerrad self-assigned this Jan 10, 2020
@nerrad nerrad added type: bug The issue/PR concerns a confirmed bug. skip-changelog PRs that you don't want to appear in the changelog. status: needs review labels Jan 10, 2020
Copy link
Member

@haszari haszari left a comment

Choose a reason for hiding this comment

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

Tested and confirmed this fixes the js errors.

Code changes look good to me – thanks for jumping on this @nerrad 🎉

@nerrad nerrad merged commit 2245022 into master Jan 13, 2020
@nerrad nerrad deleted the fix/improper-prop-usage-in-payment-method-components branch January 13, 2020 15:08
@nerrad nerrad added this to the Future Release milestone Jan 27, 2020
@nerrad nerrad modified the milestones: Future Release, 2.6.0 Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
skip-changelog PRs that you don't want to appear in the changelog. type: bug The issue/PR concerns a confirmed bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants