Skip to content

Basename and dynamic basename #72

@klis87

Description

@klis87

All my urls start with lang, like /en, /en/contact etc. A perfect case for basename, especially dynamic one. I considered to switch from RFR to Rudy, because based on https://github.com/respond-framework/rudy/blob/master/packages/rudy/src/actions/changeBasename.js I figured that in Rudy we can change basename, so lang change would be much easier. Sadly, it doesn't work I am afraid.

I have:

  const {
    reducer: routerReducer,
    middleware: routerMiddleware,
    firstRoute,
    api,
  } = createRouter(routesMap, {
    basename: '/en',
  });

but basename does nothing, generally I migrated the whole app to Rudy and it seems to work fine, but basename is '' looking at Redux location state.

If this is not supported, could you consider adding this dynamic basename feature to RFR? This is very common use case for routers, and right now I need to have :lang param in all urls which is very inconvenient.

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