r/reactjs • u/timmonsjg • Dec 03 '18
Needs Help Beginner's Thread / Easy Questions (December 2018)
Happy December! ☃️
New month means a new thread 😎 - November and October here.
Got questions about React or anything else in its ecosystem? Stuck making progress on your app? Ask away! We’re a friendly bunch. No question is too simple. 🤔
🆘 Want Help with your Code? 🆘
- Improve your chances by putting a minimal example to either JSFiddle or Code Sandbox. Describe what you want it to do, and things you've tried. Don't just post big blocks of code!
- Pay it forward! Answer questions even if there is already an answer - multiple perspectives can be very helpful to beginners. Also there's no quicker way to learn than being wrong on the Internet.
Have a question regarding code / repository organization?
It's most likely answered within this tweet.
New to React?
🆓 Here are great, free resources! 🆓
38
Upvotes
View all comments
1
u/__inactive__ Dec 26 '18
Hey everyone, have hopefully a pretty new dev question about controlled form inputs. I’ve implemented a controlled type=text input and everything is working as expected for the most part except my lingering question around clearing the input.
Coming from an angularJs world, 2way binding a model to an input was very easy to work with when needing to clear or reset the value. Since I know have a controlled react component where the internal state / user input is driving the value, I’m not sure what the best practice is to achieve this is. Setting a random prop and then updating the state when it changes? Doesn’t seem right, but not sure what else to do.
Thanks in advance!