Closed Tbutnyakov closed 3 years ago
Hello!
How can i get access to component method, wrapped react-meteor-data container?
For example this code will work.
export default class Main extends Component { constructor(props) { super(props); } openModal(){ this.refs.modal.handleToogle() } render(){ return( <div> <a href="#" onClick={this.openModal.bind(this)}> <Modal ref="modal" /> </div> ) } } export default class Modal extends Component { constructor(props){ super(props); this.state = { open:false } } handleToogle() { this.setState({ open: !this.state.open }); } }
But if i will wrap Modal component via create container i will can't get access for Modal methods. Instead in 'ref' will store react-meteor-data constructor...
How can i get access to component methods directly? Thank you!
Any update??!?
I'm closing this just because it's too old. We can open new issues for items that are still valid.
Most of these items were solved already or replaced by new strategies (like hooks)
Hello!
How can i get access to component method, wrapped react-meteor-data container?
For example this code will work.
But if i will wrap Modal component via create container i will can't get access for Modal methods. Instead in 'ref' will store react-meteor-data constructor...
How can i get access to component methods directly? Thank you!