-
Notifications
You must be signed in to change notification settings - Fork 57
Closed
Description
Having a component like this
render({ project, greeting }) {
const test = {
name: "myButton",
};
return (
<section>
<button {...test} onclick={() => {}}>
My button
</button>
</section>
);
}Causes this error:
webpack compiled with 1 error
ERROR in ./src/Home.jsx
Module build failed (from ./node_modules/nullstack/loaders/add-source-to-node.js):
TypeError: Cannot read properties of undefined (reading 'name')
at /Users/macbookpro/nullstack-spread-onclick/node_modules/nullstack/loaders/add-source-to-node.js:16:72
at Array.find (<anonymous>)
at JSXIdentifier (/Users/macbookpro/nullstack-spread-onclick/node_modules/nullstack/loaders/add-source-to-node.js:16:53)
at NodePath._call (/Users/macbookpro/nullstack-spread-onclick/node_modules/@babel/traverse/lib/path/context.js:53:20)
at NodePath.call (/Users/macbookpro/nullstack-spread-onclick/node_modules/@babel/traverse/lib/path/context.js:40:17)
at NodePath.visit (/Users/macbookpro/nullstack-spread-onclick/node_modules/@babel/traverse/lib/path/context.js:100:31)
at TraversalContext.visitQueue (/Users/macbookpro/nullstack-spread-onclick/node_modules/@babel/traverse/lib/context.js:103:16)
at TraversalContext.visitSingle (/Users/macbookpro/nullstack-spread-onclick/node_modules/@babel/traverse/lib/context.js:77:19)
at TraversalContext.visit (/Users/macbookpro/nullstack-spread-onclick/node_modules/@babel/traverse/lib/context.js:131:19)
at traverseNode (/Users/macbookpro/nullstack-spread-onclick/node_modules/@babel/traverse/lib/traverse-node.js:24:17)
@ ./src/Application.jsx 16:0-26 65:44-48
@ ./client.js 2:0-44 3:32-43 15:45-17:7 16:28-39 15:6-17:8
Repository replicating the problem: https://github.com/Stefuu/nullstack-spread-props-issue
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels