How do I get a query param from a string in next.js?
Answered
noli posted this in #help-forum
noliOP
Using an example string, I typed:
but it keeps printing
const searchParams = new URLSearchParams("https://randomlink.com/collection?i=hjd29JND");
console.log(searchParams.get('i'));
but it keeps printing
Null
and I can't find anything to help.Answered by noli