Napping Panda Missionaries

    react-node-resolver
    DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/react-node-resolver package

    2.0.1 • Public • Published

    React Node Resolver

    A generic technique for resolving the DOM node of any react component.

    Build Status

    Install

    yarn add react-node-resolver

    Use

    import NodeResolver from 'react-node-resolver';
     
    class ObfuscatedComponent extends Component {
      render() {
        return <div id="inaccessible-node" />;
      }
    }
     
    class GroovyThing extends Component {
      getNode = (ref) => {
        console.log(ref); // <div id="inaccessible-node" />
      }
      render () {
        return (
          <NodeResolver innerRef={this.getNode}>
            <ObfuscatedComponent />
          </NodeResolver>
        );
      }
    }

    Props

    Property Type Description
    children Element A single react Component
    innerRef ElementRef Callback ref ref => this.node = ref

    Install

    npm i react-node-resolver

    DownloadsWeekly Downloads

    39,180

    Version

    2.0.1

    License

    MIT

    Unpacked Size

    6.58 kB

    Total Files

    5

    Last publish

    Collaborators

    • jedwatson
    • jossmac