single-spa-react
single-spa-react copied to clipboard
Parcel appendTo appears to be broken
When I set appendTo
on a Parcel, I get a mount failure. The error leads back to the following line:
https://github.com/single-spa/single-spa-react/blob/c2cf48547226484d2e30ca74b90393ae6c998b01/src/parcel.js#L49
When appendTo is set, the following React.createElement
call never happens, so this.el
is never set.
https://github.com/single-spa/single-spa-react/blob/13e9fc86a567e94145be99b0d879e1c5fabb5e16/src/parcel.js#L104
When the call to getParcelProps function is made on line L51
the domElement
is internally set to undefined, and the spread overrides the created domElement
on L50
https://github.com/single-spa/single-spa-react/blob/13e9fc86a567e94145be99b0d879e1c5fabb5e16/src/parcel.js#L155
My question is, does this look like a bug, or is it related to my use-case currently. It seems like a bug.
Swapping lines L51 with L50 so that the newly generated domElement
is added after the getParcelProps call does resolve the issue.
Happy to create a PR if required.
Hi, I've encountered this issue as well, any plans on fixing it? I can also open a pr if needed.
@alanquigley-toast @MilanKovacic sorry for pinging you but I need to decide if I proceed with a workaround or wait for a fix
Hi, PRs are always welcome. Feel free to submit one. If possible, also set up a minimal reproduction repository.
Thanks @MilanKovacic, I've opened pr #199 and also added reproduction repository in the description.