gatsby-plugin-react-i18next icon indicating copy to clipboard operation
gatsby-plugin-react-i18next copied to clipboard

How to handle Nested Routes?

Open AdamQuadmon opened this issue 4 years ago • 1 comments

Is there a way to have nested routes works? my page config is like this:

pages: [
        {
          matchPath: '/:lang?/:uid',
          getLanguageFromPath: true,
        },
      ]

paths like \section and \it\section works correctly

but paths like \section\sub and \it\section\sub are not, these are set as en pages and have the routed flag set true

instead it\it\section\sub is created as a new path for it language

is it possible to workaround this? maybe with a different regex for matchPath?

AdamQuadmon avatar Oct 20 '21 15:10 AdamQuadmon

adding a new entry in the pages config make the nested route work but it is not nice

pages: [
        {
          matchPath: '/:lang?/section/:uid',
          getLanguageFromPath: true,
        },
        {
          matchPath: '/:lang?/:uid',
          getLanguageFromPath: true,
        },
      ]

AdamQuadmon avatar Oct 20 '21 17:10 AdamQuadmon