question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

revalidateOnMount not working on react-native

See original GitHub issue

Bug report

Description / Observed Behavior

I added revalidateOnMount option to useSWR, but it doesn’t seem to revalidate, no requests get fired after I open a screen for the second time.

Expected Behavior

It should revalidate all requests when re-opening screen

Repro Steps / Code Example

I tried to prove the bug, but here I have the complete opposite behaviour. Can’t turn the revalidation off 😕

https://snack.expo.io/@svrnlombaert/thoughtful-apple

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
matt-oakescommented, Sep 8, 2020

Just to cross post this here, I have found the issue that’s causing this and submitted a PR to fix it. It’s easy to fix this yourself using patch-package.

0reactions
huozhicommented, Mar 19, 2021

Close this as it’s more like a react native runtime issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

API - SWR
SWR is a React Hooks library for data fetching. SWR first returns the data from cache (stale), then sends the fetch request (revalidate),...
Read more >
Can I fetch data only once when using swr? - Stack Overflow
With swr, I can get data immediately when I'm not the first time access the page. But still, it calls the api to...
Read more >
[Solved]-Disable prefetch on SWR-Reactjs - appsloveworld.com
React · How to disable image fade in effect in React Native? ... Problem when creating 3 Column Card Grid using Bulma &...
Read more >
@pioul/swr - npm
React Hooks library for remote data fetching. Latest version: 0.2.3-1, last published: 3 years ago. Start using @pioul/swr in your project ...
Read more >
React Native (@reactnative) / Twitter
0.71.0-rc.2 of #reactnative⚛️ release is out! We did RC1 yesterday but there was a problem iOS side, so we tackled it quickly and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found