In TypeScript, you can combine two interface types like this
interface Foo {
var1: string
}
interface Bar {
var2: string
}
type Combined = Foo & Ba
You can't remove properties from already existing interfaces. Even trying to extend existing interface with the interface having value
property set as optional will return an error.
To avoid this issue, modify the typings of the target component so value
property is optional.
e.g.
// ...
class MyComponent extends React.Component<{value?: string}, State> {
// ...
}
and then component produced when using High Order Function
const valuedComponent = valueHOC(MyComponent);
won't ask for value
prop.