react-router-modal
react-router-modal copied to clipboard
Usage with preact
Hi, i'm trying to use this with preact and i get an error described here
If outDelay is 0
the bug doesn't happen, when you add a delay it triggers the above error
The error is in this line
Changing the if condition to fixes the problem:
if (!modals || modals.length === 0) {
return null;
}
I don't know if this is the right fix or if it's another thing that's not right @davidmfoley what do you think ? Also @developit i saw that you answered that stackoverflow question, do you have any idea ?
I don't know enough about preact to be able to help out here. Might it have something to do with preact's handling of a component where the state is initialized "inline" rather than via an explicit setState call?
I think I found and fixed this bug in version 1.5.1. Please let me know if you get a chance to test it.