Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Youtube in React: get search param
export const getSearchParam = (location, name) => {
if (!location || !location.search) {
return null;
}
const searchParams = new URLSearchParams(location.search);
return searchParams.get(name);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.