Skip to content

Make sure findDOMNode works on test renderer #8753

@sophiebits

Description

@sophiebits

This injection is missing in the stack test renderer:

findDOMNode._injectStack(function(inst) {
inst = getHostComponentFromComposite(inst);
return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null;
});

Something similar should be added near here:

https://github.com/facebook/react/blob/master/src/renderers/testing/stack/ReactTestRendererStack.js#L136

Without that, you get a "Missing injection for stack findDOMNode" error when calling findDOMNode in files that use ReactTestRenderer (and don't use ReactDOM). Would be great to repro the error with a test and then fix it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions