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've been using styled components for a while now. However recently I have been seeing the following type error.
Type error: 'Styled.Article' cannot be used as a JSX component.
Its returntype'ReactElement<WithOptionalTheme<{ id?: string; slot?: string; style?: CSSProperties; title?: string; dir?: string; hidden?: boolean; children?: ReactNode; onTouchStart?: TouchEventHandler<HTMLElement>; ... 250 more ...; onTransitionEndCapture?: TransitionEventHandler<...>; } & Partial<...>, any>, string | JSXElementC...' is not a valid JSX element.
97 |
98 |return (
> 99 |<Styled.Article id={slug?.current}>| ^
100 | {featuredImage?.src &&<Styled.CardImg src={featuredImage.src} alt="" />}
101 |
102 |<Styled.CardContent>
error Command failed with exit code 1.
It is not completely obvious what change triggered this or if it just happening on my machine. Other developers have been able to run 'yarn build' without running into this issue.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've been using styled components for a while now. However recently I have been seeing the following type error.
It is not completely obvious what change triggered this or if it just happening on my machine. Other developers have been able to run 'yarn build' without running into this issue.
Beta Was this translation helpful? Give feedback.
All reactions