Skip to content

Instantly share code, notes, and snippets.

@batuhansahan
Created March 14, 2020 22:05
Show Gist options
  • Select an option

  • Save batuhansahan/b38e404a9cb88598764882c965b4bc3d to your computer and use it in GitHub Desktop.

Select an option

Save batuhansahan/b38e404a9cb88598764882c965b4bc3d to your computer and use it in GitHub Desktop.

Revisions

  1. batuhansahan created this gist Mar 14, 2020.
    20 changes: 20 additions & 0 deletions hooks4.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    import React, {useState} from 'react'

    export default function App(props){
    const [name, setName] = useState('Reactish')

    function handleNameChange(e){
    setName(e.target.value)
    }

    return (
    <div>
    <div>Name:</div>
    <input
    value={name}
    onChange={handleNameChange}
    />
    </div>
    );

    }