@ampa/nextjs-router

yarn add @ampa/nextjs-router

Usage no npm install needed!

<script type="module">
  import ampaNextjsRouter from 'https://cdn.skypack.dev/@ampa/nextjs-router';
</script>

README

@ampa/nextjs-router

Plugin for @ampa/core to use with nextjs-router

Install

yarn add @ampa/nextjs-router

Example

import { PageTransition } from '@ampa/core' // the core component
import { createUseNextRouter } from '@ampa/nextjs-router' // one of the hooks for different routers
...
  <PageTransition
    useRouter={createUseNextRouter()}
    timeout={{ enter: 900, exit: 900 }}
    routeAnimations={routeAnimations}
  >
    <Component {...pageProps} />
  </PageTransition>

Requirements

React 16.8 and higher