Categories
Live Streams Videos

Live Stream: Session Notes

Live stream session notes.

Link to live streams: https://kananrahimov.com/live/

How to run?

npm run dev
yarn run dev
npx next dev

Dynamic Routing Example:

Posts. Fle name: /posts.js

function PostsPage() {
    return (
      <div>
        <div>List of posts!</div>
        <ul>
          <li>Lorem ipsum 1</li>
          <li>Lorem ipsum 2</li>
          <li>Lorem ipsum 3</li>
          <li>Lorem ipsum 4</li>
        </ul>
      </div>
    );
  }
  
  export default PostsPage;

Post by ID. File name: /posts/[id].js

import { useRouter } from 'next/router'

const Post = () => {
  const router = useRouter()
  const { id } = router.query

  return <p>You are reading post: {id}</p>
}

export default Post

Follow-ups:

  1. Example API and FE for Static Generation.

By Kanan Rahimov

Sr. Software Engineer

Leave a Reply