Skip to content

Latest commit

History

History
38 lines (22 loc) 路 928 Bytes

2023-05-20.md

File metadata and controls

38 lines (22 loc) 路 928 Bytes
publish_date tags
2023-05-20
dev-journal
nextjs
TIL

rewriting jweidesigns.com with next 13 app dir today some thoughts:

  • typing url params stills sucks , there has got to be better way:
type BlogSlugPageProps = {

params: { slug: string };

};

  

export default function BlogSlugPage({ params }: BlogSlugPageProps) {

const slug = params.slug;

  

return <>Slug page | {slug}</>;

}
  • you can't "opt out" of global layouts. Instead its important to think about layouts in terms of layout groups. But how do you wrap the index page into a group? 馃

turns out this the more informative doc that explains how route groups work https://nextjs.org/docs/app/building-your-application/routing/route-groups

  • it works by wrapping sections of your UI code into folders named with parenthesis