Allow slotName/match to be a Component, by using an array(this might
change in the short term).
Showing
1 changed file
with
3 additions
and
1 deletions
... | @@ -18,8 +18,10 @@ for (const [ matcher, handler ] of replacers) { | ... | @@ -18,8 +18,10 @@ for (const [ matcher, handler ] of replacers) { |
18 | } | 18 | } |
19 | 19 | ||
20 | const nextDebug = debug ? debug - 1 : 0 | 20 | const nextDebug = debug ? debug - 1 : 0 |
21 | const [ Component, componentArgs ] = Array.isArray(slotName) ? slotName : [] | ||
21 | --- | 22 | --- |
22 | { | 23 | { |
23 | slotName ? slotHandler(slotName, node) | 24 | Component ? (<Component {...componentArgs} debug={nextDebug} replacers={replacers} slotHandler={slotHandler}/>) |
25 | : slotName ? slotHandler(slotName, node) | ||
24 | : <Node parent={parent} node={node} index={index} debug={nextDebug} replacers={replacers} slotHandler={slotHandler}/> | 26 | : <Node parent={parent} node={node} index={index} debug={nextDebug} replacers={replacers} slotHandler={slotHandler}/> |
25 | } | 27 | } | ... | ... |
-
Please register or sign in to post a comment