Skip to content

Commit

Permalink
React cannot return undefined (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericclemmons committed Apr 26, 2022
1 parent 5f1633e commit 10fc042
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/perfect-baboons-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"click-to-react-component": patch
---

Return `null` instead of `undefined` to fix React warning
2 changes: 1 addition & 1 deletion packages/click-to-react-component/src/ContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export const ContextMenu = React.forwardRef(
}, [arrowX, arrowY, placement])

if (!target) {
return
return null
}

const instances = getReactInstancesForElement(target).filter((instance) =>
Expand Down

0 comments on commit 10fc042

Please sign in to comment.