Created
March 14, 2016 23:46
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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