Skip to content

Instantly share code, notes, and snippets.

@malectro
Created March 14, 2016 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malectro/d7dbad30491ecbe2ae40 to your computer and use it in GitHub Desktop.
Save malectro/d7dbad30491ecbe2ae40 to your computer and use it in GitHub Desktop.
Example of how `wrappedRef` would relate to `ref` in the case of FluxComponent-wrapped components.
import React, {Component} form 'react';
import MyComponent from 'my-component.jsx'; // wrapped by FluxComponent
class ParentComponent extends Component {
componentDidMount() {
assert(this.fluxComponent.getWrapped() === this.childEl);
}
render() {
return <MyComponent ref={el => this.fluxComponent = el} wrappedRef={el => this.childEl = el} />
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment