@digigov/nextjs
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

@digigov/nextjs

Next.js utilities for @digigov projects.

Included,

  • common _app and _document components with support for,

    • SSR style handling.
    • @digigov/ui/app/App component.
    • use @digigov/ui/navigation/Link/LinkProvider to set next/Link as the default Link component across app.
  • react-i18next initializer

Usage

$ yarn add @digigov/nextjs

Create _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.

/@digigov/nextjs/

    Package Sidebar

    Install

    npm i @digigov/nextjs

    Weekly Downloads

    218

    Version

    1.1.4

    License

    BSD-2-Clause

    Unpacked Size

    60.8 kB

    Total Files

    38

    Last publish

    Collaborators

    • kpap
    • tsironis
    • vkefallinos.grnet
    • thanasisk00