0

我有以下代码:

import { Page } from "@shopify/polaris";
import { ResourcePicker}  from "@shopify/app-bridge/actions";
import { useState } from "react";
const Index = () => {
  const [opened, setOpened] = useState(false)

  return <Page title="Product import" primaryAction={{content: 'Select products', onAction:() => setOpened(true)}} >
    { opened && <ResourcePicker resourceType={'Product'} open={opened} ></ResourcePicker> }
  </Page>

}
export default Index;

当我单击按钮打开模式时,出现错误:
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render method of Index

它与教程中的描述完全相同。
谢谢

4

0 回答 0