Skip to content

Latest commit

History

History
17 lines (13 loc) 路 682 Bytes

hoist-non-react-statics.md

File metadata and controls

17 lines (13 loc) 路 682 Bytes

hoist-non-react-statics

The HOCs we have in our API (appWithI18n), do not use hoist-non-react-statics in order not to include more kb than necessary (static values different than getInitialProps in the pages are rarely used). If you have any conflict with statics, you can add hoist-non-react-statics (or any other alternative) in the configuration.

i18n.js

const hoistNonReactStatics = require('hoist-non-react-statics')

module.exports = {
  locales: ['en', 'ca', 'es'],
  defaultLocale: 'en',
  // you need to add:
  staticsHoc: hoistNonReactStatics,
  // ... rest of conf
}