0

I am using redux connect and and react-localization-redux in same application. Both are needed export default like below

in react-localize-redux

export default withLocalize(App);

in {connect} react-redux

export default connect(mapStateToProps, mapDispatchToProps)(InvoiceAuditMenu)

How to pass both in one module.

1 Answer 1

1

You can't export 2 things as default.

Use one as a default export & use other as a named export.

export const withLocalizeApp = withLocalize(App);
export default connect(mapStateToProps, mapDispatchToProps)(InvoiceAuditMenu);

OR

export default withLocalize(App);
export const connectedInvoiceAuditMenu = connect(mapStateToProps, mapDispatchToProps)(InvoiceAuditMenu);

Or you can default export an object containing both functions like

const obj = {
 withLocalize: withLocalize(App),
 connectedInvoiceAuditMenu: connect(mapStateToProps, mapDispatchToProps)(InvoiceAuditMenu)
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.