Skip to content

Typescript: withObservables does not properly check types #123

Description

@larkox

Let a component like:

const myComponent = ({myList: string[]}) => {
    ...
}

If we pass a more general within withObservables, instead of typescript complaining, it appears as valid:

const wo = withObservables() => {
    const list: Observable<(string|number)[]> = ...
    return {myList: list}
}

Expected result:
Some error saying that types are not compatible, since the return type of withObservables ((string|number)[]) is not assignable to the props (string[]).

Some other examples:

  • Props: string, withObservables return: string|undefined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions