1.0.2 • Published 3 years ago
@fwnanodev/cra-template-router v1.0.2
@fwnanodev/cra-template-router
This @fwnanodev/cra-template-router template is based off cra-template that has react-router-dom v6 set up already with 5 pre-routed pages plus a Layout.jsx. It is mainly used for our Azure static web app creation script. You can find it in npmjs package feed.
It is also configured to work with Azure Static Webapps.
Usage
You can use it by specifying:\
npx create-react-app my-custom-template-project --template @fwnanodev/router
Configuration
Once the project is built, you can customize the component names. To rename RootComponent into Home:
- Rename
/pages/RootComponent/RootComponent.jsxto/pages/Home/Home.jsx - Inside the newly renamed
Home.jsx, changeRootComponenttoHome - Then in
route-constants.js, renameROOT_COMPONENT_NAMEtoHOME_COMPONENT_NAMEandROOT_COMPONENT_ROUTEtoHOME_COMPONENT_ROUTE
After the components are renamed to your liking, you can begin adding your custom react code as normal.
Additional Information
For more information, you can always refer to the create-react-app documentation:
- Getting Started – How to create a new app.
- User Guide – How to develop apps bootstrapped with Create React App.