Skip to content

Types issue with 1.6.0 #113

@AbhinavRobinson

Description

@AbhinavRobinson

Hi, while updating to 1.6.0, I found couple of type issues.

  1. It might be worth using popoverDirection: "up" | "down" instead of enums.

Why?

Screenshot 2023-04-14 at 2 00 55 PM

  1. Use | instead of & in Configs['shortcuts']
shortcuts?: {
        today?: string;
        yesterday?: string;
        past?: (period: number) => string;
        currentMonth?: string;
        pastMonth?: string;
    } | { // <----- change here
        [key: string]: ShortcutsItem;
    };

This avoids type override, ie, typescript will not combine types today into string.

Why?

Screenshot 2023-04-14 at 2 00 34 PM

I will submit a PR shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions