I have two urls in my project. the first one: http://localhost:3000/?/#chain=Matic, and the other one: http://localhost:3000/?/#chain=Bsc. I want the function I created to run when entered with this url. How can I do that?
For example, when this http://localhost:3000/?/#chain=Matic address is entered, I want the relevant function to be loaded automatically after the page is loaded. Is there a way to do this?
Thank you very much.
You'd want to amend the URL so that we're pulling from the get parameters. Then we can look for the variable when the page first loads and run logic depending on what the value is:
Here's a complete example: https://codesandbox.io/s/resolve-url-parameter-2odpc