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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

.htaccess - ERR_TOO_MANY_REDIRECTS htaccess -