Closed guymalka closed 6 years ago
Hey @guymalka, it does work with redux.
Here's an example of how to integrate it with redux: https://codesandbox.io/s/xvr74ln96q
Hope it helps!
@schiehll i have tried this and it is not working
Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
Hi @schiehll, thank you for the codesandbox. However, when I tried to reproduce it on my code, it does not work. The redux compose() is imported as a function, not a HOC, so the Home could not be rendered. The redux package version is the same. Error is returned as below.
Warning: Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.
@Hienphamthe if you are using the v5 of this lib, try something like this:
export default compose(
// See the extra () here? This wasn't needed in previous versions
withAlert(),
connect(mapStateToProps),
...
)(YourComponent)
can this project work with react-redux? withalert(connect ()()) does not work