-
Notifications
You must be signed in to change notification settings - Fork 78
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
Export type for buttons components props #553
Conversation
🦋 Changeset detectedLatest commit: 36fedc4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
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.
This is going to be a great developer experience upgrade for TypeScript devs 😄 Great work.
One comment for conversation ⬇️
@@ -201,122 +201,155 @@ type OnShippingAddressChangeActions = { | |||
|
|||
export type DisplayOnlyOptions = "vaultable"; | |||
|
|||
export type PayPalButtonCreateOrder = ( |
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.
This is totally my fault for putting this in the ticket, but wanted to throw this out there:
Do you think we should prefix these types with PayPalButtons___
instead of PayPalButton___
to match PayPalButtonsComponentOptions
? 🤔
Open to either option 😄 But just thought I'd start the conversation.
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.
I think PayPalButton__
is better since we split them into a single button.
@@ -201,122 +201,155 @@ type OnShippingAddressChangeActions = { | |||
|
|||
export type DisplayOnlyOptions = "vaultable"; | |||
|
|||
export type PayPalButtonCreateOrder = ( |
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.
Was there any discussion around why these types live in paypal-js
instead of alongside the components they describe? I'm sure there's some history there, and it's not a blocker on this PR.
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.
I don't know about any discussion around this. Were you thinking of importing it from checkout-components?
Split up each prop in into its own type to export
// Old way
const styles: PayPalButtonsComponentOptions["styles"] = { ...your_button_styles }
// New way
const styles: PayPalButtonsStyles = { ...your_button_styles }