Search code examples
javascriptreactjsredux

withRouter + connect + i18next not working together. How to fix it?


React-Redux Error

const mapStateToProps = state => {
    const { error } = state.Login;
    return { error };
}

export default compose(withRouter(withNamespaces()), connect(
    mapStateToProps,
))(ProfileMenu);

**It's not working with the i18next, without it yes, how to fix?


Solution

  • compose is a functional method which composes functions with each other.

    Try this:

    export default compose(withRouter(), withNamespaces(), connect(mapStateToProps))(ProfileMenu);