title: Pass a parameter into namespace in react i18next
body: <p>I am using <a href="https://react.i18next.com/latest/withtranslation-hoc" rel="nofollow noreferrer">react i18next</a> and I need to pass namespace which I get from the previous screen as a navigation prop. Code for my second screen is as follows.</p>
  <pre><code>import { withTranslation } from &quot;react-i18next&quot;
  let params = &quot;&quot;
  
  class SecondScreen extends PureComponent {
      constructor(props) {
        super(props)
        const { navigation } = props
        params = navigation.getParam(&quot;params&quot;, {})
      }
      render() {
        ....
      }
  }
  export default withTranslation([`namespace1/${params}`])(SecondScreen))
  </code></pre>
  <p>I got that it can be done using <a href="https://react.i18next.com/latest/usetranslation-hook" rel="nofollow noreferrer">useTranslation</a>, but I need to continue my work with <a href="https://react.i18next.com/latest/withtranslation-hoc" rel="nofollow noreferrer">withTranslation</a> as I am using class components. Any help would be highly appreciated!!!</p>