Typing Higher-Order Components
function withTitle<U extends { title: string }>(
title: string,
Component: React.ComponentType<U>
) {
return withInjectedProps({ title }, Component);
}
function withTitle<U extends { title: string }>(
title: string,
Component: React.ComponentType<U>
) {
return withInjectedProps({ title }, Component);
}