NEWS: Welcome to my new homepage! <3

feat: Added props spread syntax - figure - Unnamed repository; edit this file 'description' to name the repository.

figure

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 0905e9b1cd3f06f4f25ebd37de3bc03a18e7517c
parent 41969f2b241cf0c29055b7472e44585ef00fc99e
Author: typable <contact@typable.dev>
Date:   Sat,  1 Jul 2023 23:12:11 +0200

feat: Added props spread syntax

Diffstat:
Mlib.js | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/lib.js b/lib.js @@ -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[]} */ ([]);