Skip to content

react-redux v.7 doesn't allow refs on connected components #1291

@jeremygottfried

Description

@jeremygottfried

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
When I updated to the latest version of react-redux, I started seeing the following warning on many of my connected components.

react-dom.development.js:506 Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

React doesn't allow refs on functional components, so any components that were accessed with a ref in past react-redux versions are now broken.

What is the expected behavior?
My connected components that were previously exposed with refs would still be able to have a ref.

Which versions of React, ReactDOM/React Native, Redux, and React Redux are you using? Which browser and OS are affected by this issue? Did this work in previous versions of React Redux? react v.16.8.6, react-dom v.16.8.6, react-redux v.7.0.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions