react-scan
react-scan copied to clipboard
`on*` callbacks passed in the `useScan/scan`'s options are never called
Explanation what I mean:
useScan({
onRender: (...args) => console.log('onRender', args), // it won't call ever
})
Handlers are always ignored during scan creation. It happens because ReactScanInternals.options.value doesn't include handlers keys and isOptionKey, which called in validateOptions function, always returns false for them.
function isOptionKey(key) {
// It doesn't include handlers keys, so it will returns false for them
return key in ReactScanInternals.options.value;
}