-
Hi there 👋 The docs don't really tell me much. What's the difference between Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey! Since SWR has focus revalidation enabled by default, And const [show, setShow] = useState(false)
return <>
{show ? <Foo/> : null}
<button onClick={() => setShow(!show)}>toggle</button>
</> Say if you have a SWR hook inside Both option has its own default value that you can find in the docs, hope this answer helps! |
Beta Was this translation helpful? Give feedback.
Hey! Since SWR has focus revalidation enabled by default,
focusThrottleInterval
is to prevent doing a lot of revalidations if the window is getting and losing focus too frequently. So basically it means "do focus revalidation, but don't do it again during thefocusThrottleInterval
timespan".And
dedupingInterval
is more general and it's the deduplication duration for more things, including focus revalidations. For example this is controlled bydedupingInterval
:Say if you have a SWR hook inside
<Foo>
, when clicking the toggle button, it will be mounted s…