You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const[int,setInt]=useState(0)const{ data }=useSWR('/api',{refreshInterval: int})return<>{data}<buttononClick={()=>setInt(int+1000)}>update</button></>
Sometimes the received data will not be updated from the data source upon interval changes. Need to refine the interval change logic and remove refreshInterval from the useEffect deps, and use a ref for it.
Also we need a test to make sure it'll be stable in the future.
The text was updated successfully, but these errors were encountered:
When changing
refreshInterval
dynamically:Sometimes the received
data
will not be updated from the data source upon interval changes. Need to refine the interval change logic and removerefreshInterval
from theuseEffect
deps, and use a ref for it.Also we need a test to make sure it'll be stable in the future.
The text was updated successfully, but these errors were encountered: