hook to check if a path matches just any route #10857
-
hi, i would like to know if there is a way to know if a path, like "/something/very/nested" is defined in the current router or not. Meaning if there is just any match in the router of the path is invalid. i would like to make this check from a nested component, so using hooks would be ideal. the value of the path is a state variable so it could change with user interaction |
Beta Was this translation helpful? Give feedback.
Answered by
brophdawg11
Sep 11, 2023
Replies: 1 comment 4 replies
-
I think you want https://reactrouter.com/en/main/utils/match-routes |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
brophdawg11
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you want https://reactrouter.com/en/main/utils/match-routes