Design comparison
Solution retrospective
Hello! I've recently been learning to use React, (approximately 1 month), how do you see the code? I accept any comment to improve, Thank you! -The option to tip manually does not work, I did not know how to do it. Hello! I've recently been learning to use React, (approximately 1 month), how do you see the code? I accept any comment to improve, Thank you! -The option to tip manually does not work, I did not know how to do it.
Community feedback
- @fazzaamiarsoPosted over 2 years ago
Hello Facundo! Congratulation on finishing the project!
I can give you a high-level solution for your question.
function Tips({selectTip}) { const [ customTip, setCustomTip ] = useState('') const inputChangeHandler = (e) =>{ setCustomTip(e.target.value); selectTip(e.target.value) } return ( <section className='section_tips'> <p>Select Tip %</p> <div className='div_tips'> //other buttons <input type='number' placeholder='Custom' value={customTip} onChange={inputChangeHandler } /> </div> </section> ) }
I hope it can give you an insight. Here is a resource I recommend you to get started with React https://kentcdodds.com/blog/how-to-react.
Keep on coding!
Marked as helpful0@FacualemandiPosted over 2 years ago@fazzaamiarso thanks for your answer! it has helped me 👍
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord