react native - My object is undefined in componentdidmount after calling mapdispatchtoprops to dispatch a thunk -
i trying render data automatically component when render it. have fired off thunk in mapdispatchtoprops gets data firebase database , adds redux state. have set component did mount trigger dispatch correctly can seen in redux log.
as can see object returning undefined, if trigger these actions buttons in simulator returns object fine. know it's component lifecycle, should doing in componentwillreceive props before componentdidmount?
here componentdidmount, mapdispatchtoprops , mapstatetoprops.
componentdidmount() { const { onmountfetchusers } = this.props onmountfetchusers() const nameparsed = json.stringify(this.props.names) console.log("nameparsed =" + nameparsed); }
Comments
Post a Comment