next.js/test/development/pages-dir/client-navigation/fixture/pages/nav/as-path-using-router.js
as-path-using-router.js19 lines357 B
import React from 'react'
import Router from 'next/router'

export default class extends React.Component {
  constructor(...args) {
    super(...args)
    this.state = {}
  }

  componentDidMount() {
    const asPath = Router.asPath
    this.setState({ asPath })
  }

  render() {
    return <div className="as-path-content">{this.state.asPath}</div>
  }
}
Quest for Codev2.0.0
/
SIGN IN