使用SAP UI5 Web Components開發(fā)React應(yīng)用
2020-03-31 08:32:27 閱讀:- 來源:
(1) 命令行 npx create-react-app my-app --template @ui5/cra-template-webcomponents-react
創(chuàng)建名為my-app的react應(yīng)用,并安裝對(duì)應(yīng)的依賴。
成功執(zhí)行后,會(huì)看到Success! Created my-app at XXXX的提示信息:
進(jìn)入my-app項(xiàng)目的src文件夾里,新建MyApp.jsx:
import React from "react";
export function MyApp() {
return
My root component
;}
在App.js里導(dǎo)入這個(gè)Component:
npm start
瀏覽器里輸入localhost:3000, 就能看到這個(gè)最簡(jiǎn)單的React應(yīng)用了: