Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

on click button change route next js

import Router from 'next/router'

componentDidMount(){
    const {pathname} = Router
    if(pathname == '/' ){
       Router.push('/hello-nextjs')
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #click #button #change #route #js
ADD COMMENT
Topic
Name
4+1 =