Try find parent when couldn't find a React instance ( has source) for the element
See original GitHub issueexport function getSourceForElement(
/**
* @type {HTMLElement}
*/
element
) {
const instance = getReactInstanceForElement(element)
const source = getSourceForInstance(instance)
if (source) return source
console.warn("Couldn't find a React instance for the element", element)
}
Now in getSourceForElement
, when we can’t find source of an element, we just return undefined.
Can we try to find a parent React instance which has a source?
Issue Analytics
- State:
- Created a year ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Invariant Violation: Could not find "store" in either the context ...
It's pretty simple. You're trying to test the wrapper component generated by calling connect()(MyPlainComponent) .
Read more >Error: "Cannot add child "18903" to parent "18774" because ...
The reason DevTools throws is that the Progress Fiber's owner (the _debugOwner attribute) points to a Body Fiber that hasn't been mounted yet....
Read more >Troubleshooting Guide - React Flow
A possible solution is to wrap your component with a <ReactFlowProvider /> or move the code that is accessing the state inside a...
Read more >Forwarding Refs - React
const FancyButton = React.forwardRef((props, ref) => ( <button ref={ref} className="FancyButton"> {props.children} </button> )); // You can now get a ref ...
Read more >Troubleshooting | React Navigation
This can happen if you are passing non-serializable values such as class instances, functions etc. in params. React Navigation warns you in this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Potentially related, I’m getting an error when Option+clicking an element:
Ah, good point! If Babel isn’t transpiling a 3rd party lib’s JSX (because it’s already
React.createElement
), then there won’t be any__source
.This looks like an easy fix that I should be able to reproduce, too!