Skip to content

Conversation

bc-dronov
Copy link
Contributor

@bc-dronov bc-dronov commented Sep 8, 2025

What/Why?

StripeShippingForm component migrated to the functional

Rollout/Rollback

Revert this PR

Testing

Manual testing

Screen.Recording.2025-09-10.at.14.29.46.mov

@bc-dronov bc-dronov requested a review from a team as a code owner September 8, 2025 11:27
@bc-dronov bc-dronov force-pushed the feat/stripe_shipping_form_functional branch from a1fc892 to efac3da Compare September 8, 2025 11:59
@bc-dronov bc-dronov requested a review from PavlenkoM September 8, 2025 12:07
@@ -32,192 +27,178 @@ import hasSelectedShippingOptions from '../hasSelectedShippingOptions';
import ShippingFormFooter from '../ShippingFormFooter';

import StripeShippingAddress from './StripeShippingAddress';
import { useCheckout } from '@bigcommerce/checkout/payment-integration-api';
import { EMPTY_ARRAY } from '../../common/utility';

export interface SingleShippingFormProps {
Copy link
Contributor

Choose a reason for hiding this comment

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

We are trying to eliminate prop drilling while refactoring components.
If possible, could you please remove props that can be read from checkout state and access them from checkout context directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

You should be able to remove customerMessage: string; now, once we are working on refactoring <Shipping />, we could remove more props here.

Copy link
Contributor Author

@bc-dronov bc-dronov Sep 10, 2025

Choose a reason for hiding this comment

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

@bc-peng We’re currently passing customerMessage from the parent StripeShipping component, which retrieves it from checkout context. Since we’re using customerMessage in the props mapper (outside of a React component), accessing context directly there would cause an error. That’s why I think it’s better to keep customerMessage as a prop.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I see. I missed the Formik HOC here. Thanks for the explanation.

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