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
Whenever I use the scrollIntoView-function that is returned from the useScrollIntoView-hook I get an ESlint error called @typescript-eslint/no-floating-promises.
The reason for this seem to be that the function is typed to return a Promise but is not returning anything.
The result of this is that any attached catch will not work since catch is not defined on undefined.
warning
Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
The return type is Promise<void> indeed because the function is async, this is a perfectly ok return type for an async function that doesn't return anything meaningful
Whenever I use the scrollIntoView-function that is returned from the
useScrollIntoView
-hook I get an ESlint error called@typescript-eslint/no-floating-promises
.The reason for this seem to be that the function is typed to return a Promise but is not returning anything.
The result of this is that any attached
catch
will not work sincecatch is not defined on undefined
.@typescript-eslint/no-floating-promises
My own research leads me to think this might be related to Hermes not supporting Async arrow functions. But this code below snippet does work, so it's not apparent for me.
Details
(I've fixed it with ignore next line, but thought it might be interesting to know)
The text was updated successfully, but these errors were encountered: