Skip to content

Regexp routes redirecting #31

Description

@ivan-suhorukov

Now, when i use a RegExp routes, i cannot use openPage or redirectPage functions. Router throws RegExp routes are not supported. So may be we can support this by adding second converter to route? Something like this:

export const $router = createRouter({
  profile: [/\/(student|teacher|manager)\/profile/, (urlRole) => { return { role: urlRole }}, (urlRole) => `/${urlRole}/profile`],
                                                                                 where it is  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
})

So router can determine the redirect url and do redirect?

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