Skip to content

talves/react-static-dynamic-menus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React-Static - Custom Routing Example

This example includes:

  • CSS imports
  • Image imports
  • File imports
  • Custom routing

To get started, run react-static create and use the custom-routing template.

Automatic component routing vs custom routing

In automatic component routing, you setup your routes in getRoutes of static.config.js, where you specify the path and the appropriate component for that path:
{path: 'foo', component: 'src/components/MyFoo'} This is the easiest way to specify routes.

In custom component routing, you also setup your routes in getRoutes of the static.config.js, but you don't specify the component! {path: 'foo'} Instead, you specify the routes in the components <Route path='/foo' component={MyFoo} \>. It's important to note that you can use one method or the other, but not both.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published