single-spa-react icon indicating copy to clipboard operation
single-spa-react copied to clipboard

Parcel never mounts component with StrictMode enabled

Open eljo opened this issue 2 years ago • 3 comments

With React 18 development library and <React.StrictMode> the <Parcel> component does not mount the actual parcel.

Observed flow:

  • componentDidMount is called which calls addThingToDo
  • componentWillUnmount is called which calls addThingToDo and immediately sets this.unmounted = true
  • First addThingToDo is invoked and immediately returns as this.unmounted is true.

eljo avatar Jan 13 '23 13:01 eljo

Hi, did you solve the problem?

MilanKovacic avatar Oct 09 '23 04:10 MilanKovacic

I just stumbled upon this same scenario.

webJose avatar Nov 11 '23 21:11 webJose

We experience the same issue. We use the Parcel component and what I noticed is that it mounts it, it's visible for a split of a second and then it unmounts it. Could it be that in the second render of StrictMode the parcel is considered mounted? Some timing issue maybe? I hope you can figure it out soon.

BournazosHarry avatar Jan 12 '24 15:01 BournazosHarry