-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Bug report
Description / Observed Behavior
In some scenarios, I'd expect onSuccess to be called, but it doesn't. E.g. a route "/foo" populate the state inside SWR's onSuccess. If I quickly navigate /foo -> /other -> /foo before the request from the first /foo finishes fetching, the onSuccess from the second /foo won't run. The result is that the state in the second /foo remains the initial state.
Expected Behavior
Since the first /foo already unmounted, I'd expected the onSuccess from the second /foo to run. Alternatively, there should be a way for configure SWR so onSuccess always runs, even if the request was deduped.
Additional Context
SWR version: 1.0.1
jcwillox, BertrandBordage and BartoszKlonowski
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working