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

fix: message props update without button teardown #536

Merged
merged 3 commits into from
Jul 25, 2024

Conversation

danzhaaspaypal
Copy link
Contributor

@danzhaaspaypal danzhaaspaypal commented Jul 10, 2024

There was a bug where updating button message properties such as amount would tear down then rebuild the entire button component to render the new message. This fix allows just the message to rerender and preserves the button.

Testing instructions:

Setup

  • open this paypal-js PR locally
  • execute npm run build in paypal-js
  • open paypal-js file explorer to packages/react-paypal-js/dist and copy the cjs and esm directories
  • open this lighthouse-ecommerce AKA "Palmart" PR locally
  • run npm install
  • open Palmart file explorer to node_modules/@paypal/react-paypal-js/dist
  • delete the cjs and esm directories
  • paste copied cjs and esm directories there
  • delete .next directory (previous node_module builds are cached there, and we do not want to use those)
  • execute npm run dev
    • if it does not launch and gives node: --openssl-legacy-provider is not allowed in NODE_OPTIONS, you must first set the node version to the version specified in the .nvmrc file

Validation

  • go to a product page and change the item quantity. The button message quantity should update but not tear down the buttons.

Copy link

changeset-bot bot commented Jul 10, 2024

🦋 Changeset detected

Latest commit: 33bec07

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@paypal/react-paypal-js Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@danzhaaspaypal danzhaaspaypal marked this pull request as ready for review July 19, 2024 15:17
@danzhaaspaypal danzhaaspaypal requested a review from a team as a code owner July 19, 2024 15:17
@danzhaaspaypal danzhaaspaypal merged commit dcd618c into main Jul 25, 2024
3 checks passed
@danzhaaspaypal danzhaaspaypal deleted the fix-message-update branch July 25, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants