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
// --> I see an error here <--constMenuItemLinkRoot=styled(MenuItem,{name: 'MenuItemLink',slot: 'Root',overridesResolver: (props,styles)=>styles.root,})<MenuItemLinkProps>``constuseUtilityClasses=(ownerState: Partial<MenuItemLinkProps>)=>{constslots={root: ['root'],}returnunstable_composeClasses(slots,getMenuItemLinkUtilityClass,ownerState.classes)}// --> and here <--constMenuItemLink=(props: MenuItemLinkProps)=>{const{ className, classes, ...rootProps}=propsconstslotClasses=useUtilityClasses({ classes })constrouteMatch=useRouteMatch(props.toasstring)return(<MenuItemLinkRoot{...rootProps}className={classnames(slotClasses.root,className)}selected={props.to===routeMatch?.path}/>)}const_MenuItemLink=React.memo(MenuItemLink)astypeofMenuItemLinkexportdefault_MenuItemLink
So as marked by the comments above, I see the error Fast refresh only works when a file only exports components. Move your component(s) to a separate file.
As I am only exporting one component from this file, this seem incorrect.
I would guess this is to do with the leading _ on the default export.
If I change the code so that: -
MenuItemLink becomes _MenuItemLink
_MenuItemLink becomes MenuItemLink
(so that the exported name starts with a capital, and the non-exported component startds with a _)
then it works without error.
The text was updated successfully, but these errors were encountered:
Given the following code...
So as marked by the comments above, I see the error
Fast refresh only works when a file only exports components. Move your component(s) to a separate file.
As I am only exporting one component from this file, this seem incorrect.
I would guess this is to do with the leading
_
on the default export.If I change the code so that: -
MenuItemLink
becomes_MenuItemLink
_MenuItemLink
becomesMenuItemLink
(so that the exported name starts with a capital, and the non-exported component startds with a
_
)then it works without error.
The text was updated successfully, but these errors were encountered: