【问题标题】:How to work with multiple pages project with create-react-app?如何使用 create-react-app 处理多页项目?
【发布时间】:2017-02-06 18:07:29
【问题描述】:

我最近在尝试create-react-app,我发现它只能处理一个名为'index.html'的默认页面。我想知道,如果我的项目是多页的,我可以开发我的使用 create-react-app 的前端?如何?
我知道我可以使用 react-router 来完成我的工作,但是,我仍然想找到一种使用 create-react-app 处理多个页面的方法。我错了吗 ?

【问题讨论】:

    标签: reactjs create-react-app


    【解决方案1】:

    你没有错。可能您只是对多页应用程序和单页应用程序感到困惑。您需要了解和使用 react-router 模块以及 ReactJS。 React 路由器为 React 应用程序提供路由功能。 (由于使用 react,您正在创建一个 SPA 单页应用程序)。

    有关更多和深入的信息,请查看此链接: https://github.com/ReactTraining/react-router

    【讨论】:

    • 谢谢!让我试试!
    猜你喜欢
    • 1970-01-01
    • 2019-03-20
    • 2018-02-10
    • 2018-07-21
    • 2022-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-16
    相关资源
    最近更新 更多