Original code:
const Product = props => { const plus = () => { // Call props.onVote to increase the vote count for this product }; const minus = () => { // Call props.onVote to decrease the vote count for this product }; return (
{/* Product name */}
-
votes: {/* Number of votes*/}
+
{" "}
-
); }; class GroceryApp extends React.Component { // Finish writing the GroceryApp class onVote = (dir, index) => { // Update the products array accordingly ... }; render() { return (
{/* Render an array of products, which should call this.onVote when + or - is clicked */}
); } } document.body.innerHTML = "
"; ReactDOM.render(
, document.getElementById('root')); console.log(document.getElementById('root').innerHTML)
Dashboard
Start Trial
Sign In
Home
Product
Features
Use Cases
Customers
ROI Calculator
Integrations
Assessments
Tests
Questions
Pricing
Resources
Book: Evidence-Based Hiring
Blog
Support
Contact Us
Legal
For Jobseekers
© TestDome, 2024.