Pie Logo
Exercise: Server vs Client Components
by Tomas Trescak

ContentDetailed description of the section content.

Installation

Reuse the code from the previous exercise. Make sure to complete it before attempting this one.

Instructions

  1. Complete all the user requirements below
  2. Cover each user requirement by end-to-end test (tag each test by “@components”)
  3. If necessary, cover utility code and component code by unit tests
  4. Commit and push the code
  5. Make sure all tests pass
  6. Commit and push your code to your repository

User Requirements

  1. If the post has no image associated, get a random image from either:
    1. Cat API
    2. Dog API
  2. As a user, I want to be able to hide a post in the list
  3. As a user, I want to be able to unhide all posts
  4. As a user, I want to keep all hidden posts invisible when reloading the page

When using local storage, you will receive a hydration error, how would you solve this?

Full Stack Development
Introduction
Generative AI
🍰 Player
💼 Editor
Setup
React Fundamentals
Next.js
Why Next.js?
Next.js Introduction
Monorepos
Turborepo
Assignment 2.1: Blog - Client
Layouts and Pages
Fonts and Images
Styling
Server vs Client Components
Quiz: Server vs Client Components
Exercise: Server vs Client Components
Static and Dynamic Rendering
Leaderboards
Advanced React
Databases
React Hooks
Authentication and Authorisation
APIs
CI/CD and DevOps
Testing React
Advanced Topics
    Pie Logo
    Exercise: Server vs Client Components
    by Tomas Trescak

    ContentDetailed description of the section content.

    Installation

    Reuse the code from the previous exercise. Make sure to complete it before attempting this one.

    Instructions

    1. Complete all the user requirements below
    2. Cover each user requirement by end-to-end test (tag each test by “@components”)
    3. If necessary, cover utility code and component code by unit tests
    4. Commit and push the code
    5. Make sure all tests pass
    6. Commit and push your code to your repository

    User Requirements

    1. If the post has no image associated, get a random image from either:
      1. Cat API
      2. Dog API
    2. As a user, I want to be able to hide a post in the list
    3. As a user, I want to be able to unhide all posts
    4. As a user, I want to keep all hidden posts invisible when reloading the page

    When using local storage, you will receive a hydration error, how would you solve this?

    Full Stack Development
    Introduction
    Generative AI
    🍰 Player
    💼 Editor
    Setup
    React Fundamentals
    Next.js
    Why Next.js?
    Next.js Introduction
    Monorepos
    Turborepo
    Assignment 2.1: Blog - Client
    Layouts and Pages
    Fonts and Images
    Styling
    Server vs Client Components
    Quiz: Server vs Client Components
    Exercise: Server vs Client Components
    Static and Dynamic Rendering
    Leaderboards
    Advanced React
    Databases
    React Hooks
    Authentication and Authorisation
    APIs
    CI/CD and DevOps
    Testing React
    Advanced Topics
    Pie Logo
    Exercise: Server vs Client Components
    by Tomas Trescak
    Pie Logo
    Exercise: Server vs Client Components
    by Tomas Trescak
    Full Stack Development
    Introduction
    Generative AI
    🍰 Player
    💼 Editor
    Setup
    React Fundamentals
    Next.js
    Why Next.js?
    Next.js Introduction
    Monorepos
    Turborepo
    Assignment 2.1: Blog - Client
    Layouts and Pages
    Fonts and Images
    Styling
    Server vs Client Components
    Quiz: Server vs Client Components
    Exercise: Server vs Client Components
    Static and Dynamic Rendering
    Leaderboards
    Advanced React
    Databases
    React Hooks
    Authentication and Authorisation
    APIs
    CI/CD and DevOps
    Testing React
    Advanced Topics
    Full Stack Development
    Introduction
    Generative AI
    🍰 Player
    💼 Editor
    Setup
    React Fundamentals
    Next.js
    Why Next.js?
    Next.js Introduction
    Monorepos
    Turborepo
    Assignment 2.1: Blog - Client
    Layouts and Pages
    Fonts and Images
    Styling
    Server vs Client Components
    Quiz: Server vs Client Components
    Exercise: Server vs Client Components
    Static and Dynamic Rendering
    Leaderboards
    Advanced React
    Databases
    React Hooks
    Authentication and Authorisation
    APIs
    CI/CD and DevOps
    Testing React
    Advanced Topics