Using refs with react-redux 6 | How to Use Refs on Connected Components

ref={ref => this.chartsComponent = ref.getWrappedInstance()}
connect(null, null, null, { withRef: true })(ChartsComponent);

{withRef: true} is removed in react redux 6 and {forwardRef : true} is added

ref={ref => this.chartsComponent = ref }
connect(null, null, null, { forwardRef: true })(ChartsComponent);



Senior Mobile Application Developer at Cubix Inc with more than 6 years of experience in React Native/Android/iOS

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store