-
Notifications
You must be signed in to change notification settings - Fork 64
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
Bug - shadow variable clash with destructured props #1193
Bug - shadow variable clash with destructured props #1193
Conversation
🦋 Changeset detectedLatest commit: ccefa7f 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 |
@harshmalde run |
…nto bug/shadowed-var-clash-with-destructured-props
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.
There is still a VR fail to address.
FAIL chrome.docker/chrome.laptop/conditional rules/styled/Condition With Destructured Props Key Value String: Failed to render with error "primary is not defined"
This is caused by a story within stories/conditional-rules-styled.tsx
The fix doesn't seem to take into account cases such as
const DestructuredPropsKeyValueString = styled.div<TextProps>`
${({ isPrimary: primary }) => (primary ? 'color: green' : 'color: red')};
`;
…nto bug/shadowed-var-clash-with-destructured-props
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.
Looks good! Just the leftover console log
This reverts commit 4f8f2aa.
Issue Description:
When shadow variable name and deconstructed
props
property are same, babel is unable to differentiate between them (since both the property will be of typeIdentifier
and you can have a look at the storybook that has been created with this PR).Implementation:
This pull request helps to reconstruct the destructed props in the Arrow function.