@fwnanodev/cra-template-router

1.0.2 • Public • Published

@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.jsx to /pages/Home/Home.jsx
  • Inside the newly renamed Home.jsx, change RootComponent to Home
  • Then in route-constants.js, rename ROOT_COMPONENT_NAME to HOME_COMPONENT_NAME and ROOT_COMPONENT_ROUTE to HOME_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:

Package Sidebar

Install

npm i @fwnanodev/cra-template-router

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

22.1 kB

Total Files

25

Last publish

Collaborators

  • emilys314