Create-react-app: How to create more than one pages?

Created on 3 Aug 2016  路  5Comments  路  Source: facebook/create-react-app

How can I create more than two pages rather than just index.html? What's the structure like?

for example, I would like to add another page "fun.html" along with "index.html", and I want to have "fun.js", "fun.css" under src file. But it doesn't work.

How to do that? Thanks!

Most helpful comment

Before using React Router, I would recommend to get familiar with HTML5 History API and experiment with it on a small page just to get a sense of the problem React Router is solving.

All 5 comments

Is that necessary to have other html files? Did you consider using https://github.com/reactjs/react-router to set up routing in the app?

@zebapy I am new to reactjs, I have not tried react-router yet. Thanks for your suggestion, I am going to try it.

Thanks!

@Batur24 the tool you're definitely looking for is React Router: https://github.com/reactjs/react-router

Typically in React you wont be creating new .html files, but rather creating routes.

Before using React Router, I would recommend to get familiar with HTML5 History API and experiment with it on a small page just to get a sense of the problem React Router is solving.

@eanplatter, @gaearon Thanks a lot! I will go to check it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xgqfrms-GitHub picture xgqfrms-GitHub  路  3Comments

Evan-GK picture Evan-GK  路  3Comments

barcher picture barcher  路  3Comments

alleroux picture alleroux  路  3Comments

wereHamster picture wereHamster  路  3Comments