We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2542c6a commit a9db3e1Copy full SHA for a9db3e1
packages/click-to-react-component/src/getSourceForElement.js
@@ -22,7 +22,10 @@ export function getSourceForElement(
22
23
function getFirstParentElementWithSource(element) {
24
const parentElement = element.parentElement
25
- if (parentElement === null) throw new Error('No parent found')
+ if (parentElement === null) {
26
+ console.warn("Couldn't find a React instance for the element", element)
27
+ throw new Error('No parent found for element')
28
+ }
29
30
const instance = getReactInstanceForElement(parentElement)
31
const source = getSourceForInstance(instance)
0 commit comments