Replies: 1 comment
-
Hey, this is something that would be supported if we add something like this #11556 you would be able to add your own logic for matching routes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a use case that right now it's not supported by React Router but it was back in the day, in RR5.
I work with a CMS that uses a concept that is called "object traversal" to retrieve the objects stored in the CMS database.
The objects are stored in an objects/documents DB that is able to store them in a hierarchically way (as a file system, with parent/child structure). So they map the way it's stored directly with the natural organization of a website:
/folder/nested-folder/page
in the DB, the folder object is the parent of nested-folder and this one, will be parent of page.
so when the user calls that URL, it traverses the tree until it gets to the page content, then that content is rendered.
We can match this via "splat" routes, all fine.
Then, the tricky part. The traversal concept also accepts the idea of "views" or actions applied to the content objects. Then the edit view route becomes:
/folder/nested-folder/page/edit
I noticed this can't be achieved, nor in RR, nor in any other modern router. We are using RR5, which supported this back then, but I noticed that RR6 does not support it either.
In RR5 this is what we are doing right now:
Is that something that it'd sensible to add as a feature? is it difficult to achieve?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions