davidmfoley / react-router-modal

Simple modals for react-router 4
MIT License
153 stars 20 forks source link

Prevent a race condition? on initial page loads #3

Closed walaura closed 7 years ago

walaura commented 7 years ago

Okay not gonna lie i'm not quite sure if this is a good idea

Thing is on a project I'm working on, when refreshing or just browsing to a route on a modal on the initial pageload this.state.id on line 88 will be undefined by the time the execution hits there, leaving things in an inconsistent state. This seems to fix it

walaura commented 7 years ago

haha oops awkward, i was on 1.1.8, it's not happening on the last one 😅

davidmfoley commented 7 years ago

Yeah I hit that one as well. Thanks for the report, though. Constructor might be the best place for that, TBH.