Skip to content

Commit

Permalink
Merge pull request #1539 from vivekmahajan/fix-preact-warning
Browse files Browse the repository at this point in the history
Fix console warning in preact due to  Trans accessing node.children first
  • Loading branch information
jamuhl committed Jul 29, 2022
2 parents d710a15 + b1f9f0a commit a4fd6ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Trans.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function hasChildren(node, checkLength) {

function getChildren(node) {
if (!node) return [];
return node && node.children ? node.children : node.props && node.props.children;
return node.props ? node.props.children : node.children;
}

function hasValidReactChildren(children) {
Expand Down

0 comments on commit a4fd6ef

Please sign in to comment.