Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
...options,
},
})
if (whileTap || whileHover) {
useWhileInteraction({
ref,
animateToFrame,
from: to,
whileHover,
whileTap,
})
}
// Deep compare the `animate|to` @Frame so that we can animate updates.
useDeepCompareEffectNoCheck(() => {
if (!mountRef.current) {
animateToFrame(to, true)
mountRef.current = true
return
}
if (!isVisible && exit) {
animateToFrame(exit, true)
} else {
if (isExiting) return
animateToFrame(to, true)
}
visibilityRef.current = isVisible
}, [isVisible, to])
error: action.error,
isReady: true,
}
default:
return state
}
},
{
result: null,
error: null,
isLoading: false,
isReady: false,
}
)
useDeepCompareEffect(() => {
let ignore = false
async function fetchData() {
try {
const {data} = await api().post('/', rpcBody)
if (!ignore) {
dataDispatch({type: 'done', ...data})
}
} catch (error) {
if (!ignore) {
dataDispatch({type: 'fail', error})
}
}
}
if (rpcBody.method) {