Home > Mobile >  How to extract hashtags in URL?
How to extract hashtags in URL?

Time:03-06

www.app.com/home#tag_name

In React, how do I extract tag_name in the above URL? Is there are any built in functions to do that?

CodePudding user response:

This may help. https://www.codegrepper.com/code-examples/javascript/get url hashtag javascript

window.location.hash = '#hash_value';

location.hash

CodePudding user response:

history.location.hash

The above worked

  • Related