Admin links Examples using React and Node

pjv0580
New Member
2 0 0

Trying to develop an app (react node and Polaris) and i wanted to add an Admin Link for the product details page. I have wired up the link but when the link hits my product create page i am unable to access the query string values. There is no example that i could find in the react node example. 

 

How can i access the query parameters from inside a React.Component?

Example is my Admin Link will create https://xxx.myshopify.com/admin/apps/contentApp/create?id=17231912345051&shop=xxx.myshopify.com. I a...

id = 17231912345051

shop =xxx.myshopify.com

0 Likes
achieveapplabs
Shopify Partner
470 36 74

Hi @pjv0580 ,

Try npm install query-string

import qs from 'query-string';

var params = qs.parse(this.props.location.search);

Best,

Achieve Team

Install Approovly to create and track order approvals | We want to hear from you hello@achieveapplabs.com | Follow us on Twitter @achieveapplabs | Custom Shopify Apps achieveapplabs.com
0 Likes