React Solution - No useEffect hook used. React icons imported.

This is my solution using React. I have seen some React solutions using useEffect when it is in my opinion not actually necessary, so I wanted to show my implementation using just the useState hook. I also imported and used React icons for the toggle icon.

View solution

Requested feedback

I want feedback on the quality of my code and its readability

Comments

insanicly(about 1 year ago)

Yes you are right, if use effect hook is not necessary. I think if anyone uses it it will be a smelling code.

insanicly(about 1 year ago)

Btw I am fail to see your code, the link is going to the original question.

You must be signed in to post a comment

Get future questions delivered straight to your inbox for free

Sign up and receive instant access to new questions when we publish them.

We‘ll only use your information to deliver new questions and to provide you updates about our product. We‘ll never spam you or sell your information without your consent. Unsubscribe at any time.