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(primitives): fixes ts strict errors Alert/Autocomplete #3292

Merged
merged 1 commit into from
Jan 11, 2023

Conversation

reesscot
Copy link
Contributor

Description of changes

Fixes TS Strict errors in Alert and Autocomplete primitives.

Description of how you validated changes

yarn react build

Checklist

  • PR description included

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@reesscot reesscot requested a review from a team as a code owner January 11, 2023 21:24
@changeset-bot
Copy link

changeset-bot bot commented Jan 11, 2023

⚠️ No Changeset found

Latest commit: 7f15a43

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@@ -36,40 +36,38 @@ const AlertPrimitive: Primitive<AlertProps, typeof Flex> = (
}
}, [setDismissed, onDismiss, dismissed]);

return (
!dismissed && (
Copy link
Contributor Author

@reesscot reesscot Jan 11, 2023

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;
Copy link
Contributor Author

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

@reesscot reesscot temporarily deployed to ci January 11, 2023 21:44 — with GitHub Actions Inactive
@reesscot reesscot temporarily deployed to ci January 11, 2023 21:44 — with GitHub Actions Inactive
@reesscot reesscot temporarily deployed to ci January 11, 2023 21:44 — with GitHub Actions Inactive
@reesscot reesscot temporarily deployed to ci January 11, 2023 21:44 — with GitHub Actions Inactive
@reesscot reesscot merged commit 830933e into main Jan 11, 2023
@reesscot reesscot deleted the reesscot-ts-strict-5 branch January 11, 2023 22:08
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.

4 participants