rekit icon indicating copy to clipboard operation
rekit copied to clipboard

why do you duplicate route inside the file routeConfig.js

Open cesc1802 opened this issue 6 years ago • 1 comments

i have got a question. why do you duplicate route inside routeConfig.js and please provide the context to use it

cesc1802 avatar Dec 20 '19 07:12 cesc1802

I have the same doubth. I wonder why use the isIndex property hack instead of just handling the routes as any other react-router way. I mean, that you just descibe the main route of a feature like this:

export default {
  path: '/',
  name: 'Home',
  childRoutes: [
    { path: '',
      name: 'Default page',
      component: DefaultPage,
    },
  ],
};

It is much simpler to understand (and is how the /examples works). What is the value in having to remember that

export default {
  path: '/',
  name: 'Home',
  childRoutes: [
    { path: 'default-page',
      name: 'Default page',
      component: DefaultPage,
      isIndex: true
    },
  ],
};

Means that such route will be duplicated as injected as path: ''?

danielo515 avatar Jan 16 '20 10:01 danielo515