Skip to content

Commit

Permalink
fix for calling hasClass on component that renders null
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos committed Nov 13, 2016
1 parent 42efa3b commit 5964f06
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/MountedTraversal.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ export function instEqual(a, b, lenComp) {

export function instHasClassName(inst, className) {
const node = findDOMNode(inst);
if (!node) { // inst renders null
return false;
}
if (node.classList) {
return node.classList.contains(className);
}
Expand Down

0 comments on commit 5964f06

Please sign in to comment.