JSTQL-JS-Transform/output_testing/440find-dom-node.js

19 lines
443 B
JavaScript
Raw Normal View History

/**
* Provides a standard way to access a DOM node across all versions of
* React.
*/
import { reactPaths } from './react-loader';
const React = window.React;
const ReactDOM = window.ReactDOM;
export function findDOMNode(target) {
const {
needsReactDOM
} = reactPaths();
if (needsReactDOM) {
return target |> ReactDOM.findDOMNode(%);
} else {
// eslint-disable-next-line
return target |> React.findDOMNode(%);
}
}