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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.

className=" cursor-pointer text-2xl"
/>
</li>
Expand Down Expand Up @@ -78,7 +78,7 @@ export default function Home() {
developer, I've done remote work for
<span className="text-teal-500"> agencies </span>
consulted for <span className="text-teal-500">startups </span>
and collaborated with talanted people to create digital products
and collaborated with talented people to create digital products
for both business and consumer use.
</p>
<p className="text-md py-2 leading-8 text-gray-800 dark:text-gray-200">
Expand Down Expand Up @@ -140,7 +140,7 @@ export default function Home() {
developer, I've done remote work for
<span className="text-teal-500"> agencies </span>
consulted for <span className="text-teal-500">startups </span>
and collaborated with talanted people to create digital products
and collaborated with talented people to create digital products
for both business and consumer use.
</p>
<p className="text-md py-2 leading-8 text-gray-800 dark:text-gray-200">
Expand Down