如何像在浏览器上使用 React 一样在纯 HTML 上使用 React Router
How to use React Router on pure HTML like React on browser
有没有办法像在浏览器上使用 React 一样在纯 HTML 上使用 React Router?
示例:
<script src="https://unpkg.com/react@15/dist/react.min.js"></script>
React Router 有利于 React Single Page Apps. Using it in pure HTML files isn't necessary. Here's a nice summary of React Router's purpose。
React Router, and dynamic, client-side routing, allows us to build a single-page web application with navigation without the page refreshing as the user navigates. React Router uses component structure to call components, which display the appropriate information.
您分享的代码示例暗示有兴趣使用来自 CDN rather than installing the library in your project. If that's the case, it may help to review the post 的 React。
有没有办法像在浏览器上使用 React 一样在纯 HTML 上使用 React Router?
示例:
<script src="https://unpkg.com/react@15/dist/react.min.js"></script>
React Router 有利于 React Single Page Apps. Using it in pure HTML files isn't necessary. Here's a nice summary of React Router's purpose。
React Router, and dynamic, client-side routing, allows us to build a single-page web application with navigation without the page refreshing as the user navigates. React Router uses component structure to call components, which display the appropriate information.
您分享的代码示例暗示有兴趣使用来自 CDN rather than installing the library in your project. If that's the case, it may help to review the post