Get Query from URL in reactjs shopify-CLI app

Tiber
Excursionist
18 3 1

I have an react app make with the Shopify-CLI and I am trying to get the query parameters from the URL. But I am getting a error. Is there another way to get the query string?

TypeError: Cannot read property 'params' of undefined

 

 

import React, { Component } from "react"; 
class Users extends Component { 
render() {
const { id } = this.props.match.params;
 return ( <div> <h1>User id is {id}</h1> </div> ); 
} 
} 
export default Users;

 

0 Likes