preact + ts and types issue
userquin opened this issue · 0 comments
userquin commented
Using Preact + TS:
const {
offlineReady: [offlineReady, setOfflineReady],
needRefresh: [needRefresh, setNeedRefresh],
updateServiceWorker,
} = useRegisterSW({..})
function close() {
typeof setOfflineReady === 'function' && setOfflineReady(false)
typeof setNeedRefresh === 'function' && setNeedRefresh(false)
}
without the typeof check: