Skip to content

Not able to use object props for dynamic routes #269

@jydmnd

Description

@jydmnd

The ensureIsValidRoute function flattens dynamic routes objects so that only the route prop is used as the url. It would be useful to pass the entire object instead like with static routes, so some additional props could be used in the filter function. The route prop would have to be assigned to a url prop, something like this :

function ensureIsValidRoute(route) {
  route = typeof route === 'object' ? route : { url: route }
  
  if(route.route)
    route.url = route.route

  // force as string
  route.url = String(route.url)
  return route
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions