-
Notifications
You must be signed in to change notification settings - Fork 119
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: issue with displaying product price od PDP and PLP #1053
fix: issue with displaying product price od PDP and PLP #1053
Conversation
props: { | ||
product: { | ||
type: Object as PropType<typeof useProductsWithCommonProductCardProps | null>, | ||
default: () => null, |
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.
Shouldn't this be required? You're accessing product.__typename in the template which will crash if product
is null
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.
fixed
}, | ||
props: { | ||
product: { | ||
type: Object as PropType<typeof useProductsWithCommonProductCardProps | null>, |
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.
type: Object as PropType<typeof useProductsWithCommonProductCardProps | null>, | |
type: Object as PropType<ReturnType<typeof useProductsWithCommonProductCardProps>['productsWithCommonProductCardProps']['value'][number] | null>, |
Unfortunately this is the type you're looking for. Right now in this PR it's "the product prop is a function or null (typeof useProduct... is a function that accepts products)
What I suggested is the modified product returned by the commoncardprops
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.
Awful...
92160fc
to
e3e50d7
Compare
Description
Related Issue
#973
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: