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
It might be just not integrated yet. When using forwardRef on a component and assigning args, IDE throws a type error. This happens when exporting a default function, but also when exporting default const Button. Or maybe my typings are wrong.
Reproduction
Example simplified component:
// button.tsximport{typeComponentPropsWithRef,forwardRef}from'react'exporttypeButtonProps=Omit<ComponentPropsWithRef<'button'>,'onClick'>&{/** Button color from theme */color?: stringonClick?: (data: unknown)=>void}exportdefaultforwardRef<HTMLButtonElement,ButtonProps>(({ children, className ='btn', color, type ='button', ...rest},ref)=>{return(<buttontype={type}ref={ref}{...rest}>{children}</button>)})// button.stories.tsximport{Story}from'@storylite/storylite'importButtonfrom'./button'typeStoryType=Story<typeofButton>exportdefault{title: 'Button',component: Button,args: {color: undefined,// errorchildren: 'Default',},decorators: [(Story,context)=>{return(<divclassName="example-wrapper"><Story{...context?.args}/></div>)},],}satisfiesStoryTypeexportconstMain: StoryType={name: 'Default',}
Environment
OS with version: Windows 11
Browser with version Firefox 117.0
JS Runtime with version: NodeJS v20.2.0
The text was updated successfully, but these errors were encountered:
Describe the bug
It might be just not integrated yet. When using
forwardRef
on a component and assigningargs
, IDE throws a type error. This happens when exporting adefault
function, but also when exporting defaultconst Button
. Or maybe my typings are wrong.Reproduction
Example simplified component:
Environment
The text was updated successfully, but these errors were encountered: