Skip to content
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

Cannot read property 'type' of undefined #16

Closed
lavor opened this issue Jul 20, 2020 · 0 comments
Closed

Cannot read property 'type' of undefined #16

lavor opened this issue Jul 20, 2020 · 0 comments
Labels

Comments

@lavor
Copy link

lavor commented Jul 20, 2020

Current version of library does not allow to create element attributes with object spread syntax. There was no problem in version
2.

// just artifical example for demonstration
const Example = () => {
    const dynamicAttrs = {title: "dynamic title"};
    // using spread attributes resolves in compile error "Cannot read property 'type' of undefined"
    return (<div {...dynamicAttrs}>Just test</div>);
};

node.name is undefined here:
https://github.com/insin/babel-plugin-react-html-attrs/blob/master/lib/index.js#L222

@insin insin added the bug label Jul 20, 2020
@insin insin closed this as completed in b480680 Jul 23, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants