react-node-resolver
A generic technique for resolving the DOM node of any react component.
Last updated 6 years ago by jossmac .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install react-node-resolver 
SYNC missed versions from official npm registry.

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

Current Tags

  • 2.0.1                                ...           latest (6 years ago)

4 Versions

  • 2.0.1                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
Maintainers (2)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (16)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE