Bad ways you’re using react – useState and forms

Share This Post

When you set up a form in react/react native, you’re probably setting up a state for each input in the form.

Something like this

If you have a lot of inputs, that means a lot of states and onChangeTexts. You can get rid of those, and just get the value when you need it (and avoid re-renders) if you use references

Make sure to give this post a 👏 if you learned something, and let me know in the comments below if you already knew this react mistake.

Leave a Reply

Digital art dealers

Join our vibrant community of more than 750 members by subscribing to our newsletter. Every Monday, you'll receive a programming meme to kickstart your week.

follow us on

© 2023 Digital Art Dealers. All rights reserved.