React Typescript 基本路由
React Typescript 基本路由
反应路由器dom v6
-
安装命令以创建项目。
npx create-react-app my-app --template typescript

2.运行项目:npm start

3.安装以下命令
npm install react-bootstrap 引导
npm install react-router-dom

4. 将引导样式表包含在 应用程序.tsx 或者 索引.tsx

5.文件结构

6.src/App.tsx
7. src/Routes/RouteComponent.tsx
8. src/Pages/AboutComponent.tsx
9. src/Pages/ContactusComponent.tsx
10. src/Pages/ErrorComponent.tsx
11. src/Pages/HomeComponent.tsx
12. src/components/NavbarComponent.tsx
13. src/images/logo.png

14. GitHub: https://github.com/bimsarapradeepdesilva/react-ts-basic-routing
15. 网络

16. 移动视图

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明

浙公网安备 33010602011771号