import React from "react"
import PropTypes from "prop-types"
import { Page } from '@shopify/polaris';
import { ResourcePicker } from '@shopify/app-bridge-react';
class CreateUpsell extends React.Component {
state = { open: false }
render () {
return (
);
}
handleSelection = (resources) => {
const idFromResources = resources.selection.map((product) => product.id);
this.setState({open: false})
console.log(idFromResources);
}
}
export default CreateUpsell
for some reason my console error and app.js component file didn’t load into the post, so here it is too
thanks in advance.
import {
ApolloClient,
ApolloProvider,
HttpLink,
InMemoryCache,
} from '@apollo/client';
import { AppProvider, EmptyState, Page } from '@shopify/polaris';
import { authenticatedFetch } from '@shopify/app-bridge-utils';
import enTranslations from '@shopify/polaris/locales/en.json';
import React from 'react';
import TestData from './TestData';
import CreateUpsell from './CreateUpsell'
export default function App() {
const client = new ApolloClient({
link: new HttpLink({
credentials: 'same-origin',
fetch: authenticatedFetch(window.app), // created in shopify_app.js
uri: '/graphql'
}),
cache: new InMemoryCache()
});
return (
);
}
Did you managed to fix the issue?
