-
Notifications
You must be signed in to change notification settings - Fork 1k
fix : ENG-8692 updated defaultStyles type #4029
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
Conversation
🦋 Changeset detectedLatest commit: 9743731 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
View your CI Pipeline Execution ↗ for commit 9743731.
☁️ Nx Cloud last updated this comment at |
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.
@shubham-builder I think the comment here is misleading and we should update that, defaultStyles
is a styles object provided to a component and doesn't take up any breakpoints as keys. They are spread out in the large (default) breakpoint whenever a component is inserted.
Example usage of defaultStyles:
https://github.com/sidmohanty11/builder/blob/angular-sdk-signals/packages/react/src/blocks/Button.tsx/#L33-L45
@sidmohanty11 So the type is correct, just the example was the issue here. I've updated the example and changed type to "Record" which seems more appropriate for an object. |
FYI - |
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.
while it makes sense to use React.CSSProperties
as type here, but:
- this is our core SDK (
@builder.io/sdk
) that doesn't depend upon react - React handles numeric values underneath, so if we provide
padding: 20
it addspx
to 20, so type wise it will not throw an error if a user providespadding: 20
but on the web it might fail
I think it will be better if we don't update anything here. As the same type is being used in Gen2 SDKs:
defaultStyles?: { [key: string]: string }; |
Co-authored-by: Sidharth Mohanty <sidmohanty11@gmail.com>
Description
FIX : updated defaultStyles type
TICKET - https://builder-io.atlassian.net/browse/ENG-8692
Screenshot