Is it possible to have a React component what can find out dynamically what props its got?
Example:
type BaseType = {
baseProp?: ...
as?: ...
}
type Extended = {
extendedProp?: ...
}
<Base /> // expected props => { baseProp }
<Base as={ExtendedComponent} extendedProp={...} /> // expected props => { baseProp, extendedProp }