👾 Pure Components
by Tomas Trescak· Advanced React

0 / 3310 XP

Presentation Transcript
If you prefer text to video, check out the transcript of the presentation above

Slide 1 ----------- Part 1: Let's practice pure components! Slide 2 ----------- Part 1: Your task is to implement a React app with the following requirements. Part 2: A "CounterDisplay" component displays the counter value and updates only when the counter changes. Part 3: A "StaticMessage" component displays a static message and should not re-render unless its props explicitly change. Part 4: Use React.memo to optimise the child components. Slide 3 ----------- Part 1: Again, you can depend on your tests to check if your solution is correct! Part 2: This time, pay close attention to the console and the messages within Part 3: The messages produced by your tests will follow the suite name ... Part 4: ... finished by the test name and result. Good luck!

Description
All the extra information about this section

Task: Implement a React app with the following requirements: * Create a parent component (App) that maintains a counter using useState. * Create two child components: 1. A "CounterDisplay" component that displays the counter value and updates only when the counter changes. 2. A "StaticMessage" component that displays a static message and should not re-render unless its props explicitly change. * Use React.memo to optimise the child components.

Discuss with Others
Ask questions, share your thoughts, and discuss with other learners

Join the discussion to ask questions, share your thoughts, and discuss with other learners
Loading...
Ready ...
Content Locked
This content is only available to registered users.
Please register at the the home page.
Setup
React Fundamentals
10 points
Next.js
10 points
Advanced React
Databases
10 points
React Hooks
Authentication and Authorisation
10 points
APIs
CI/CD and DevOps
Testing React
Advanced Topics