schiehll / react-alert

alerts for React
MIT License
607 stars 99 forks source link

Wrapper not passing alert if the component renders in a modal #90

Closed morinx closed 5 years ago

morinx commented 6 years ago

I see this only when I'm using either withAlert or <Alert> to wrap a component inside a modal.

All other withAlert wrappers work perfectly fine in any other component.

As a comparison, in my modals, all other wrappers like withRouter, Apollo or any other wrapper can pass their props in their Consumer except for withAlert

screen shot 2018-07-19 at 12 34 09 pm

The workaround for me has been to wrap the parent outside modal first, and then manually pass alert as a prop to the component inside modal.

I also tried mounting the modal's <Ref /> both in document.body and in the Root but still no luck.

Please let me know if there is anything else I'm missing to try out.

Thank you.

schiehll commented 5 years ago

I couldn't reproduce it, if you can give me an example showing the problem in a codesandbox I will reopen it.