Should `relfect` totally exclude properties used in `bind` from final types?
AlexandrHoroshih opened this issue · comments
Current behavior
function View(props: ViewProps) { ... }
const ReflectedView = reflect({
view: View,
bind: {
someProp: "value",
}
})
- Props type of
ReflectedView
isExclude<ViewProps, "someProp">
ReflectedView
will show type error on<ReflectedView someProp="other value" />
- But the value will still be passed to the component on top of the value from
bind
, so this will work properly in runtime
Question
This is a bit confusing:
The library just highlights that prop was already taken, but in fact allows to override it.
What is desired behavior here?
- Should
reflect
actually omit such values in runtime? - Or these props just should not be excluded at the type level and must be made optional instead?