acf23c75 by Adam Heath

Allow slotName/match to be a Component, by using an array(this might

change in the short term).
1 parent 8176f0ac
...@@ -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 }
......