Skip to content

Comments

Fix shorthand attributes handling#4

Open
antoinerousseau wants to merge 2 commits intoGeekyAnts:masterfrom
antoinerousseau:master
Open

Fix shorthand attributes handling#4
antoinerousseau wants to merge 2 commits intoGeekyAnts:masterfrom
antoinerousseau:master

Conversation

@antoinerousseau
Copy link

Fixes #3.

attrs.map(function (attr, ind) {
if (attr.type !== "JSXSpreadAttribute" && ["colorScheme", "variant", "size"].includes(attr.name.name)) {
attrs.forEach(function (attr, ind) {
if (attr.type === "JSXSpreadAttribute" || !attr.value) {
Copy link
Author

@antoinerousseau antoinerousseau Jan 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because attr.value is sometimes null, leading to these errors:

TypeError: Cannot read properties of null (reading 'type')
    at node_modules/@native-base/babel-plugin/lib/index.js:207:138

@maylukas
Copy link

@antoinerousseau Is there any ETA when this will be available? I am running into the same issue. Thanks 🙏

@antoinerousseau
Copy link
Author

@maylukas I am not the maintainer so I can't merge this PR
@rayan1810 could do it

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.

Cannot read properties of null (reading 'type') when using some shorthand boolean props

2 participants