@digigov/nextjs
v2.0.14
Published
next specific utilities for @digigov apps
Keywords
Readme
@digigov/nextjs
Next.js utilities for @digigov projects.
Included,
common
_appand_documentcomponents with support for,- SSR style handling.
@digigov/ui/app/Appcomponent.- use
@digigov/ui/navigation/Link/LinkProviderto setnext/Linkas the default Link component across app.
react-i18next initializer
Usage
$ yarn add @digigov/nextjsCreate _app and _document components,
pages/_app.js
import initI18n from '@digigov/nextjs/i18n';
import el from '../locales/el';
initI18n({
el: {
translation: el
}
});
import App from '@digigov/nextjs/App';
export default App;pages/_document.js
import Document from '@digigov/nextjs/Document';
export default Document;Drawbacks
next.js spawns two transpilation processes for SSR and client code using
different configuration options. _app, _doc are provided as raw .tsx
modules to prevent transpilation conflicts. You need to modify next.js
webpack configuration to include @digigov/nextjs components as though they
where located in locally in your project.
