Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Pass object to query on Router.push NextJs

import Router, { withRouter } from 'next/router'

performSearch = (event) => {
    event.preventDefault();
    Router.push({ pathname: '/results', state: { pattern: this.state.searchText } });
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Pass #object #query #NextJs
ADD COMMENT
Topic
Name
9+9 =