I am trying to use react to recreate my currents components (written in pure typescript) but I can\'t find a way to give additional props to a component extending an other.
The most elegant solution that I found (without extra generic class) is
interface IBaseProps {
name: string;
}
class Base extends React.Component
{
}
interface IChildProps extends IBaseProps {
id: number;
}
class Child extends Base {
render(): JSX.Element {
return (
{this.props.id}
{this.props.name}
);
}
}