Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove OptionBase type #4702

Merged
merged 8 commits into from
Aug 19, 2021
Merged

Remove OptionBase type #4702

merged 8 commits into from
Aug 19, 2021

Conversation

Methuselah96
Copy link
Collaborator

Resolves #4696.

Unfortunately due to weak type detection, it doesn't work to have an Option generic type that doesn't have any properties in common with OptionBase since all of the properties on OptionBase are optional. See the attached issue for a more concrete example that causes issues.

export interface OptionBase {
  readonly label?: string;
  readonly value?: unknown;
  readonly isDisabled?: boolean;
  readonly __isNew__?: true;
}

@changeset-bot
Copy link

changeset-bot bot commented Jul 23, 2021

🦋 Changeset detected

Latest commit: ce9d4c0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
react-select Patch
@react-select/docs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 23, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ce9d4c0:

Sandbox Source
react-codesandboxer-example Configuration

@Methuselah96 Methuselah96 added this to the 5.0 milestone Jul 23, 2021
@shulcsm shulcsm mentioned this pull request Aug 5, 2021
Copy link
Owner

@JedWatson JedWatson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Methuselah96

@JedWatson JedWatson merged commit cfd5d9f into master Aug 19, 2021
@JedWatson JedWatson deleted the remove-option-base branch August 19, 2021 23:49
@github-actions github-actions bot mentioned this pull request Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

types too strict OptionBaseType v5
2 participants