Skip to content
Discussion options

You must be logged in to vote

Hi, I think the fact you are calling mutate twice in a row make them kind of "overlap" one another.
What you should do instead is :

// update locally
mutate('key', async (activities) => {
   if (activities) return [newActivity, ...activities];
}, false);

// update db
await axios('api/createActivity');

// call mutate again in order to fetch updated data
mutate('key');

Oh and yes, it probably has nothing to do with set options.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@taylorhlabs
Comment options

Answer selected by taylorhlabs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants