Question 4 (10 marks) Write a React component that collects and displays counts of “thumbs up” and “thumbs down” as a one shown below. Tell us what you think? Customizable Message 12 2 Buttons Counters Each time the “thumbs up” or “thumbs down” buttons was clicked, the corresponding counter will increase by one. The message shown on top of the two buttons can be customized. Use the code excerpt below as template to implement your Poll class and the method call. <div id='app' /> class Poll extends React. Component { render() { return ( <div> <h6>Tell us what you think?</h6> <div class="btn-toolbar"> <button type="button" class="btn btn-primary" id="good" onclick={this.handleClick}> 👍<span class="badge badge-light">12</span></button> <button type="button" class="btn btn-primary" id="bad" onclick={this.handleClick}> 👎<span class="badge badge-light">2</span></button> </div> </div> ); } } ReactDOM.render(); Page 11 of 18
Put your complete Poll class and the method call here [10 marks]: class Poll extends React.Component { Page 12 of 18
Question 4 (10 marks) Write a React component that collects and displays counts of “thumbs up” and “thumbs down” as a on
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Question 4 (10 marks) Write a React component that collects and displays counts of “thumbs up” and “thumbs down” as a on
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!