0

I have a very simple functional component as follows:
import * as React from ‘react’;

export interface AuxProps {
children: React.ReactNode
}

const aux = (props: AuxProps) => props.children;

export default aux;

And another component:
import * as React from “react”;

export interface LayoutProps {
children: React.ReactNode
}

const layout = (props: LayoutProps) => (

Toolbar, SideDrawer, Backdrop


{props.children}


);

export default layout;

I keep on getting the following error:

[ts]
JSX element type ‘ReactNode’ is not a constructor function for JSX elements.
Type ‘undefined’ is not assignable to type ‘ElementClass’. [2605]

How do I type this correctly?

Kuldeep Baberwal Changed status to publish February 4, 2025