Skip to content

Wrong types for optional props #501

@Luchanso

Description

@Luchanso

Reproduction playground

I think in this case returning OutputSelector, not OutputParametricSelector, but I couldn't figure it out why

Workaround solution - put optional props in object:

import { createSelector } from "reselect";

type Props = {
  data?: string;
}

const selector = createSelector(
  (_: any, { data }: Props) => data,
  (data) => data
);

selector(null, "hello world");

Metadata

Metadata

Assignees

No one assigned

    Labels

    TypeScriptIssues related to TypeScript.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions