-
Notifications
You must be signed in to change notification settings - Fork 219
Avoid exposing receiveCart to extensions #4730
Conversation
Size Change: +96 B (0%) Total Size: 1.19 MB
ℹ️ View Unchanged
|
@@ -150,7 +150,7 @@ const ShippingRatesControl = ( { | |||
// Prepare props to pass to the ExperimentalOrderShippingPackages slot fill. | |||
// We need to pluck out receiveCart. | |||
// eslint-disable-next-line no-unused-vars | |||
const { extensions, ...cart } = useStoreCart(); |
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.
This was already removed (according to the comment) so it seems like it slipped in by accident on a recent refactor. Great catch!
I did think about that, we have a pattern of doing that recently, e.g. |
Makes sense. Thanks for the review @senadir! |
While working on #4688, I found a couple of instances where we were passing
receiveCart
to slot fills so it was available by extensions. This PR fixes that.Question: I wonder if we should create a hook that acts as a wrapper of
useStoreCart()
and automatically excludesreceiveCart
, so it can be used safely when making data available to extensions.Testing
Changelog