Access ref of a redux connected component -
i used have component this:
class blahdumb extends component { toggleme = () => console.log('toggling') render() { ... } } i use this:
class app extends component { doit = () => this.el.toggleme() refel = el => this.el = el; render() { return ( <div> <blahdumb ref={this.refel} /> <button onclick={this.doit} /> </div> ) } } now worked until connected blah redux.
i changed blah this:
const blah = connect(function() { ... })(blahdumb); now can no longer access toggleme this.el got via ref. bad pattern? or there way childs refs?
Comments
Post a Comment