Skip to content

Instantly share code, notes, and snippets.

@datvtwkm
Last active August 26, 2018 05:21
Show Gist options
  • Save datvtwkm/c3a88fbecaeb389431318797272731dc to your computer and use it in GitHub Desktop.
Save datvtwkm/c3a88fbecaeb389431318797272731dc to your computer and use it in GitHub Desktop.
// @flow
import React, {Component} from 'react';
import type {ComponentType} from 'react';
import B from './B'
class A extended Component<any> {
ref = {}
refB = (c: ComponentType) => {thif.ref.B = c}
getBState = (): any => ref.B.wrappedInstance.state
render(){
return(<B ref={this.refB}>)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment