a2e25c4d by Adam Heath

In react, if there is a match, but a null handler, then return

null(which is how to delete elements).
1 parent a63cda21
...@@ -57,7 +57,7 @@ export const Match = (props) => { ...@@ -57,7 +57,7 @@ export const Match = (props) => {
57 const nextDebug = debug ? debug - 1 : 0 57 const nextDebug = debug ? debug - 1 : 0
58 for (const [ matcher, Handler ] of replacers) { 58 for (const [ matcher, Handler ] of replacers) {
59 if (matcher(node, parent, index, false)) { 59 if (matcher(node, parent, index, false)) {
60 return Handler({ debug: nextDebug, parent, node, index, replacers }) 60 return Handler ? Handler({ debug: nextDebug, parent, node, index, replacers }) : null
61 } 61 }
62 } 62 }
63 if (debug) console.log('Match:nothing', {node}) 63 if (debug) console.log('Match:nothing', {node})
......