-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bug 🐞😱Something isn't workingSomething isn't working
Description
Note: maybe I am forgetting something.
I have noticed that, in this component, I am required to use an early return null:
If I instead did the following (only returning when requiresShipping is true):
const Properties = component(({ inventoryItemData, onInput }) => {
const { requiresShipping, material, weight, length, height, width } = inventoryItemData
const { t } = useTranslation('inventoryItems.shipping.properties')
if (requiresShipping) {
return (
<>
...What happens is that, whenever requiresShipping switches from true to false, the Properties component is still being rendered. Then when requiresShipping switches from false to true, a new Properties component is rendered below the old one.
Why does this happen?
Metadata
Metadata
Assignees
Labels
bug 🐞😱Something isn't workingSomething isn't working