react-redux-v6: withRef is removed. To access the wrapped instance, use a ref on the connected component

https://github.com/reduxjs/react-redux/releases/tag/v6.0.0

The withRef option to connect has been replaced with forwardRef. If {forwardRef : true} has been passed to connect, adding a ref to the connected wrapper component will actually return the instance of the wrapped component.


It's work for me:

connect(
    mapStateToProps,
    null,
    null,
    {
      forwardRef: true
    }
  )
)(ComponentName);