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

fix(toast): "key" must be optional parameter in typescript definitions #4077

Merged
merged 2 commits into from
Feb 18, 2021
Merged

fix(toast): "key" must be optional parameter in typescript definitions #4077

merged 2 commits into from
Feb 18, 2021

Conversation

avevlad
Copy link
Contributor

@avevlad avevlad commented Feb 17, 2021

Hey!

Flow type:

clear = (key?: React.Key) => {
key === undefined ? this.clearAll() : this.dismiss(key);
};

Flow type:

clear: function(key?: ?React.Key): void {
const toasterInstance = this.getRef();
if (toasterInstance) {
toasterInstance.clear(key);
} else if (__DEV__) {
// eslint-disable-next-line no-console
console.error('No ToasterContainer is mounted yet.');
}
},

Description

Typescript error:

Argument of type 'undefined' is not assignable to parameter of type 'string | number'.ts(2345)

Scope

toast

Thanks!

@vercel
Copy link

vercel bot commented Feb 17, 2021

@avevlad is attempting to deploy a commit to the Uber UI Platform Team on Vercel.

A member of the Team first needs to authorize it.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 17, 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 15c10ae:

Sandbox Source
Basic usage Configuration

@vercel
Copy link

vercel bot commented Feb 17, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/uber-ui-platform/baseweb/7zbdh1uc3
✅ Preview: https://baseweb-git-fork-avevlad-patch-2.uber-ui-platform.now.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants