2

I am still getting hang of React js. I am trying to export multiple components and i am getting this error "Identifier 'withN' has already been declared" Here is my code for export

const withN =  withNamespaces()(App)
export default connect(
  mapStateToProps,
  { logOut }
)(withRouter(Header));

Here is my import code

import { withN } from 'react-i18next';

Please tell me what is wrong.

Thanks update: After correcting my export statement as suggested by @octobus, I get this error attached in the image props undefined

1 Answer 1

1

You can't import something and reassign a value to it. The reason you are getting the error is that there is already a declaration of withN.

Sign up to request clarification or add additional context in comments.

16 Comments

This is incorrect, imports are read-only views of the exported-values
When i do that I get "withNamespaces" is not defined
@user918204 did you also import withNamespaces ?
I already imported withN. Do i need to import withNamsepaces as well?
@ElAoutarHamza You are right sir. I misunderstood the question. Updated my answer.
|

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.