Skip to content

Conversation

@DeveloperViraj
Copy link

Fixes #8100

This change moves the drinks data inside the Drink component so the component depends only on its name prop, making it a pure function component. This avoids a dependency on external data and better illustrates purity when teaching conditional rendering.

  • Moved drinks object inside Drink
  • Kept example structure intact and behavior identical
  • Verified build and local preview

Let me know if you'd prefer the data to live in the parent component and pass info down via props, happy to update to that pattern if it's preferred.

@github-actions
Copy link

Size changes

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 110.54 KB (🟡 +1 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Suggestion]: Make the Conditional Rendering example a pure function component

1 participant