polymorphic-react-component
polymorphic-react-component copied to clipboard
'Component' cannot be used as a JSX component
Copying final code gives me following error:
'Component' cannot be used as a JSX component. Its element type 'Component<any, any, any> | ReactElement<any, any> | null' is not a valid JSX element. Type 'Component<any, any, any>' is not assignable to type 'Element | ElementClass | null'. Type 'Component<any, any, any>' is not assignable to type 'ElementClass'. The types returned by 'render()' are incompatible between these types. Type 'ReactNode' is not assignable to type 'false | Element | null'. Type 'undefined' is not assignable to type 'false | Element | null'.ts(2786)
Running on React 17.0.2, tslib 2.3.1, @types/react 17.0.40 and @babel/preset-typescript 7.16.7
could you share the sample you're running @nikolasmish ?