Welcome to the Treehouse Community
Looking to learn something new?
When should I use the `match.path` over `match.url`?
This is in reference to React's React Router DOM library.
Ondrej Salamon1,501 Points
I suppose it depends on an problem you're solving.
I don't know any of React stuff or course your question is related to but generally speaking, url is "complete" address, i.e. string with protocol + domain + path + parameters, anchors etc. whereas path is just a part of url after domain (and "/") and without parameters, anchors etc.
URL: "http://www.example.com:80/path/to/myfile.html?key1=value1&key2=value2#SomewhereInTheDocument" PATH: just "/path/to/myfile.html" (Source: https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_URL)
So if you want to match something inside your app or on your local server I'd say it is safer to use "path". Because you want to match your local files or paths inside root folder of your local server you don't care about domain, protocol and so.