I had a class component with another class component as his static property. Now I switched to a function component and I don't know how to keep the static property.
class Panel extends React.Component<Props> {
public static Fieldset = PanelFieldset;
}
class PanelFieldset extends React.Component<Props> {
...
}
class App extends React.Component<Props> {
public render() {
return (
<Panel>
<Panel.Fieldset>
...
</Panel.Fieldset>
</Panel>
)
}
}
Now, switching to function component:
const Panel: React.FunctionComponent<Props> = (props) => {
Panel.Fieldset = PanelFieldset;
}
but I get the error: Property 'Fieldset' does not exist on type 'FunctionComponent'.ts(2339)
Any help?