-
Notifications
You must be signed in to change notification settings - Fork 318
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(primitives): fixes ts strict errors Alert/Autocomplete #3292
Conversation
|
@@ -36,40 +36,38 @@ const AlertPrimitive: Primitive<AlertProps, typeof Flex> = ( | |||
} | |||
}, [setDismissed, onDismiss, dismissed]); | |||
|
|||
return ( | |||
!dismissed && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TypeScript didn't like this because it means Alert
can return false
, which is not a valid ReactElement
@@ -10,7 +10,7 @@ import { | |||
} from '../Icon/internal'; | |||
|
|||
interface AlertIconProps { | |||
variation: AlertVariations; | |||
variation?: AlertVariations; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default variation of Alert and AlertIcon is actually no icon
Description of changes
Fixes TS Strict errors in Alert and Autocomplete primitives.
Description of how you validated changes
yarn react build
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.