【发布时间】:2021-07-08 09:29:52
【问题描述】:
我在流式文件中渲染 React HTML 时遇到了困难。
我总共有 3 个应用程序。
Strapi - https://my-api.com
React App - https://my-react-app.com
shopify store - https://shopify-store.com
GET https://shopify-store.com ->> GET https://my-api.com/api/get-form
上面的 URL 请求由 Shopify 商店应用发送到我的strapi 服务器,我必须返回一个 HTML。
/api/*/controller/fileName.js
const { data } = await axios.get('https://my-react-app.com/form-page');
// the above data contains react's html
ctx.send(data); // returning react's HTML to shopify store
我已经完成了上述方法,它返回 HTML,但它没有在 UI 中呈现 Html。
如果您从屏幕截图中注意到,<div id="main"></div> 是空的。
请帮我找到一个渲染 HTML 的解决方案……
谢谢。
【问题讨论】:
标签: reactjs strapi koa shopify-app shopify-template