-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"FocusLock: could not obtain ref to internal node" #123
Comments
That message was added in 2.1.1. You had a problem before, it was just not reported. The problem is quite fatal actually - FocusLock needs a DOM node to work with. |
I'm experiencing the same issue. The issue only happens in the test spec files. (using <FocusLock>
<div>test</div>
</FocusLock> |
🤷♂️. To be solved among with #125 |
I guess that is not solved, this error is actual with latest 2.9.1 version |
Sounds like I should add at least one RTL-backed test |
any updates on this issue? |
Unfortunately, I am still not able to reproduce this particular problem. If you are experiencing this problem - please suggest a broken test. |
I recently ran into this error message while creating a snapshot with the "react-test-renderer" renderer. The renderer will simply convert any provided components to pure javascript objects, and without depending on the dom. Since there is no dom this means our DOM node never gets attached to the .current, which leads us to our error statement. The solution is to manually create the element. function createNodeMock(element) {
if (element.type === "div") { // The Container's "as" prop is set to a "div" as default.
return document.createElement("div");
}
}
const tree = renderer.create( <ReactElement / > , {
createNodeMock
}); |
So that is more synthetic use case rather than a real "bug". I will correct this message to trigger only if a custom |
Appreciate it! |
Resolved in v |
Hi, currently I'm using v2.1.0.
When I upgrade to v2.1.1 and upwards, the FocusLock works still fine.
But when I update my jest-snapshots I get the following output:
Do I need to make adjustments while upgrading? Please help
The text was updated successfully, but these errors were encountered: