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
When a component imports a certain piece of code I get cryptic error message.
To Reproduce
Steps to reproduce the behavior:
Create a component story that imports the React hook detailed above.
See error in the screenshot below.
Expected behavior
I would not expect an error to happen just because I'm importing this piece of code.
Screenshots
Code snippets
// The purpose of this hook is to abstract `null` away, so we can disable linting about it/* eslint-disable @typescript-eslint/ban-types */importReactfrom'react';exportfunctionuseDOMRef<T>(): [{current: T|undefined},(node: T|null)=>void]{const[ref,setRef]=React.useState<T|undefined>(undefined);// We proxy the `null` to `undefined` valueconstonRefChange=React.useCallback<(node: T|null)=>void>((node)=>{constref=node===null ? undefined : node;setRef(ref);},[]);// Memoize the object to it doesn't cause more rerendersconstfakeRef=React.useMemo(()=>{return{current: ref,};},[ref]);return[fakeRef,onRefChange];}
I can provide more code if you like, but while debugging it doesn't seem context dependant, just a compilation issue with the code snippet I provided above.
The text was updated successfully, but these errors were encountered:
Update: as visible on the screenshot, it looks like it's actually a miss match of eslint and typescript versions. I discovered the same error while linting some files non related to Storybook.
Update 2: I'm starting to think this is due to different webpack versions overlapping (react-scripts and storybook both require a different version) because my application is on a monorepo. I'm trying hoisting at the moment.
Describe the bug
When a component imports a certain piece of code I get cryptic error message.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would not expect an error to happen just because I'm importing this piece of code.
Screenshots
Code snippets
System:
Additional context
I can provide more code if you like, but while debugging it doesn't seem context dependant, just a compilation issue with the code snippet I provided above.
The text was updated successfully, but these errors were encountered: