Skip to content

Instantly share code, notes, and snippets.

@scarstens
Created September 23, 2022 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scarstens/e7545054756e747744608e73ba4d23e4 to your computer and use it in GitHub Desktop.
Save scarstens/e7545054756e747744608e73ba4d23e4 to your computer and use it in GitHub Desktop.
import { useRouter } from "next/router";
const function getAssetTypeFirstLetterUppercase(){
const { query } = useRouter();
// Format first letter to be capitalized
const assetType = query?.type
? query?.type[0].toUpperCase() + query?.type.slice(1)
: undefined;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment