Skip to content

Commit ca86b25

Browse files
authored
Merge pull request #222 from w3bdesign/Remove-useState-antipattern
Remove useState antipattern
2 parents af16ba4 + 8020bfd commit ca86b25

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/Header/Hamburger.component.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const Hamburger = () => {
5959
id="hamburgersvg"
6060
style={showHamburgerHideXAnimation}
6161
onClick={() => {
62-
setisExpanded(!isExpanded);
62+
setisExpanded(prevExpanded => !prevExpanded);
6363
}}
6464
className="text-gray-900 fill-current"
6565
xmlns="http://www.w3.org/2000/svg"
@@ -73,7 +73,7 @@ const Hamburger = () => {
7373
<animated.svg
7474
id="xsvg"
7575
onClick={() => {
76-
setisExpanded(!isExpanded);
76+
setisExpanded(prevExpanded => !prevExpanded);
7777
}}
7878
style={showXHideHamburgerAnimation}
7979
xmlns="http://www.w3.org/2000/svg"

0 commit comments

Comments
 (0)