-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] First revalidate() + refetch() does not refresh data #497
Comments
Found same issue |
It's because of the way const [data, { refetch }] = createResource(() => clicky(), v => v); If you do that you don't even need to call |
@ryansolid I just noticed my repro doesn't line up with what I'm actually doing. Moreover, I found an... interesting workaround: revalidate('clicky');
await new Promise((resolve) => setTimeout(resolve, 1));
refetch(); Here's the updated repro: https://stackblitz.com/edit/solidjs-templates-5kavuukb?file=src%2FApp.tsx |
Describe the bug
When using createResource + query, and doing a revalidate(key) + refetch, the first invocation will not refresh data. After that, it works correctly.
Your Example Website or App
https://stackblitz.com/edit/solidjs-templates-spywaw?file=src%2FApp.tsx
Steps to Reproduce the Bug or Issue
Press the button, you would expect every click to update the timestamp, however the first click will not cause a refetch
To repeatedly reproduce you'll have to refresh the project in Stackblitz (or F5 when running locally).
Expected behavior
The first click also refreshes the data
Screenshots or Videos
No response
Platform
Stackblitz and Ubuntu
Additional context
No response
The text was updated successfully, but these errors were encountered: