Let components receive Observables as props
Opened this issue · 0 comments
kosich commented
Currently we allow intrinsic elements to receive Observable attributes, e.g.:
<img src={ of('/bird.png') } /> // > 🦉
Components don't support this feature yet, and passing an Observable to a component results in Component to be of type fn (props$: Observable<{ [key: string]: Observable<…> }>)
, which leads to boilerplate code. E.g:
<Header title={ of('title') } />
function Header(props: Observable<{ title: Observable<string> }>) {…}
With components it's unclear how exactly the API should look like: props: Observable<{ title: string }>
or props: { title: Observable<string> }
or a combination of two, or something else.
This issue is a place for further discussions and investigations of this API.