Skip to content

Conversation

@Zeko369
Copy link
Contributor

@Zeko369 Zeko369 commented Apr 25, 2024

Current example was defining a local variable with the same name as the prop which was had to understand (also technically it's a runtime error)

@vercel
Copy link

vercel bot commented Apr 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-dev 🛑 Canceled (Inspect) Apr 25, 2024 9:10pm

@github-actions
Copy link

github-actions bot commented Apr 25, 2024

Size changes

📦 Next.js Bundle Analysis for react-dev

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

This PR introduced no changes to the JavaScript bundle! 🙌

Zeko369 and others added 4 commits April 25, 2024 23:08
Co-authored-by: Ricky <rickhanlonii@gmail.com>
Co-authored-by: Ricky <rickhanlonii@gmail.com>
Co-authored-by: Ricky <rickhanlonii@gmail.com>
Co-authored-by: Ricky <rickhanlonii@gmail.com>
Copy link
Member

@rickhanlonii rickhanlonii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@vittorioromeo
Copy link

How about something simpler that doesn't promote unnecessary mutability?

  const currentTheme = (theme === 'dark') ? DarkThemeContext : LightThemeContext;
  use(currentTheme);
  
  return (
    <Page theme={currentTheme}>
      {children}
    </Page>
  );

Or even inline it in the returned expression.

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.

4 participants