Skip to content

Commit

Permalink
feat: Added props spread syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
sooophies committed Jul 1, 2023
1 parent 41969f2 commit 0905e9b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,13 @@ export default function figure(create) {
}
}
}
const propsMatch = /^\$props$/.exec(attr);
if (propsMatch) {
// bind all props which are passed to $props
for (const [key, prop] of Object.entries(value)) {
props[key] = prop;
}
}
props[attr] = value instanceof Array ? value.join('') : value;
}
const children = /** @type {ReactElement[]} */ ([]);
Expand Down

0 comments on commit 0905e9b

Please sign in to comment.