-
Notifications
You must be signed in to change notification settings - Fork 218
Convert PaymentMethodErrorBoundary to Class component #12088
Convert PaymentMethodErrorBoundary to Class component #12088
Conversation
The release ZIP for this PR is accessible via:
Script Dependencies ReportThere is no changed script dependency between this branch and trunk. This comment was automatically generated by the TypeScript Errors Report
🎉 🎉 This PR does not introduce new TS errors. |
Size Change: +1.37 kB (0%) Total Size: 1.61 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @tarunvijwani, for working on this PR! The tests are working as expected. The code mostly looks good. I left a minor suggestion below!
assets/js/blocks/cart-checkout-shared/payment-methods/payment-method-error-boundary.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@tarunvijwani could you update the Screenshots or screencast with the final result? The image in the PR description with the after result does not reflect the changes brought in by this PR |
@ralucaStan We are breaking down the solution into multiple PRs. This PR is the first part of the woocommerce/woocommerce#42256, and it only fixes the existing error by converting the PaymentMethodErrorBoundary Class component to the function component. |
What
Related woocommerce/woocommerce#42256
Why
We converted the PaymentMethodErrorBoundary Class component to the function component, and it stopped working. The issue was introduced by #9817 PR.
As per the react docs:
src: https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary
In this PR, we're converting the function component to the Class component.
We will handle removing the entire express payment block if no valid express payment button exists in a different PR.
Testing Instructions
Screenshots or screencast
WooCommerce Visibility
Required:
Checklist
Required:
[type]
label or a[skip-changelog]
label.Conditional:
[skip-changelog]
label is not present).Changelog