diff --git a/lib/utils/find-dom-node.js b/lib/utils/find-dom-node.js index 2ad55b6d5..3e2e0fb2c 100644 --- a/lib/utils/find-dom-node.js +++ b/lib/utils/find-dom-node.js @@ -7,7 +7,15 @@ */ function findDOMNode(node) { - return window.document.querySelector(`[data-key="${node.key}"]`) + const el = window.document.querySelector(`[data-key="${node.key}"]`) + + if (!el) { + throw new Error(`Unable to find a dom node for "${node.key}". This is +often because of forgetting to add \`props.attributes\` to a component +returned from \`renderNode\`.`) + } + + return el } /**