import React, {useState} from 'react'

function HookCounterThree() {
  const[name, setName]= usestate({ firstName:'', lastName:'' })
  return (
 //can overwrite previously entered input
      <input type="text" value={name.firstName} onChange={e =>setName({})/>
      <input type="text"value={name.lastName} onChange={e =>setName({})/>
//fixed using the spread operator
         <input type="text" value={} onChange={e =>setName({})/>
      <input type="text"value={} onChange={e =>setName({})/>
      <h2> Your first name is {name.firstName}</h2>
      <h2> Your last name is {name.lastName}</h2>
export default HookCounterThree
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter