Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

corrected spelling-error #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mmesomasaint
Copy link

'Talented' was wrongly spelt as 'Talanted'.

Copy link

@Dev-it-a-dev Dev-it-a-dev left a comment

Choose a reason for hiding this comment

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

PR request message doesn't imply the change at pages/index.js line 38

@@ -35,7 +35,7 @@ export default function Home() {
<ul className="flex items-center">
<li>
<BsFillMoonStarsFill
onClick={() => setDarkMode(!darkMode)}
onClick={() => setDarkMode(prev => !prev)}
Copy link
Author

@mmesomasaint mmesomasaint Oct 3, 2022

Choose a reason for hiding this comment

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

This was just for optimization, more of best practices.
Since setDarkMode happens asynchronously, other updates could happen and change the value of darkMode. If you are going to calculate the state based on the previous state, you have to make sure you have the last and most up to date value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants