Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
astro-wt
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
a2e25c4d
authored
2024-11-27 10:28:30 -0600
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
In react, if there is a match, but a null handler, then return
null(which is how to delete elements).
1 parent
a63cda21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
1 deletions
lib/react.jsx
lib/react.jsx
View file @
a2e25c4
...
...
@@ -57,7 +57,7 @@ export const Match = (props) => {
const
nextDebug
=
debug
?
debug
-
1
:
0
for
(
const
[
matcher
,
Handler
]
of
replacers
)
{
if
(
matcher
(
node
,
parent
,
index
,
false
))
{
return
Handler
({
debug
:
nextDebug
,
parent
,
node
,
index
,
replacers
})
return
Handler
?
Handler
({
debug
:
nextDebug
,
parent
,
node
,
index
,
replacers
})
:
null
}
}
if
(
debug
)
console
.
log
(
'Match:nothing'
,
{
node
})
...
...
Please
register
or
sign in
to post a comment