How to declare a global variable in React?

前端 未结 9 1249
自闭症患者
自闭症患者 2020-11-29 23:21

I initialized i18n translation object once in a component ( first component that loads in the app ) . That same object is required In all other components. I do

9条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 00:06

    You can use mixins in react https://facebook.github.io/react/docs/reusable-components.html#mixins .

提交回复
热议问题