commercelayer-react-components
commercelayer-react-components copied to clipboard
Shipment component loading forever when autoSelectSingleShippingMethod is used
Describe the bug
If you try to use the <Shipment />
component with the autoSelectSingleShippingMethod
property it won't finish loading
The cause seems to be the the loader state that never is set to false when we enter this if statement below:
File: commercelayer-react-components/packages/react-components/src/components/shipments/Shipment.tsx
It looks like everything else is working as you refresh the page the component will load.
To Reproduce
- Let only one shipping method available on Commerce Layer.
- Open a incognito window that implements the
<Shipment />
component with theautoSelectSingleShippingMethod
property set totrue
- Wait a few seconds to verify if the ShippingMethod options will load.
Note: For every test close every incognito windows opened and open a new one to always get this first load that never ends.