-1

I need to create route which dont a have route...but In some situation this route can have a dynamic data

Example in some situation is

www.test.com/home

When can be

www.test.com/home/1

/1 is id.

I need this dynamic route

Cinovates
  • 1
  • 4

1 Answers1

1

You can use route /home for the main component and route /home/:id for the some-entity-component with id = :id. Or use only route /home/* for any routes started with /home

Usually it looks like:

const definitions  = [
  {
    Component: Entities,
    path: '/entities',
  }, 
  {
    Component: Entity,
    path: '/entities/:id',
  },
];

OR with one route

const definitions  = [
  {
    Component: Entities,
    path: '/entities/*',
  }, 
];
Dmitriy Zhiganov
  • 1,060
  • 1
  • 5
  • 14