Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with redux connect #77

Open
kakariko-village opened this issue Jul 3, 2019 · 0 comments
Open

Not working with redux connect #77

kakariko-village opened this issue Jul 3, 2019 · 0 comments

Comments

@kakariko-village
Copy link

Hi, i try to use react dimensions with redux but got an error:

vendor.js:151117 Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

Check the render method of DimensionsHOC.
in ConnectFunction (created by DimensionsHOC)
in div (created by DimensionsHOC)
in DimensionsHOC
in Provider

My versions:

"react-dimensions": "^1.3.0",
"react": "^16.8.6",
"redux": "^4.0.1",

My code:

....
import Dimensions from 'react-dimensions';

....

export default Dimensions({
    getHeight: function(element) {
        return window.innerHeight - 200;
    },
    getWidth: function(element) {
        let widthOffset = window.innerWidth < 1280 ? 70 : 55;
        return window.innerWidth - widthOffset;
    }
})(connect(mapStateToProps, mapDispatchToProps)(MyComponent));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant