Created
October 14, 2020 14:06
-
-
Save codebubb/b4455fb92b2159f836a11d1e0a68eac7 to your computer and use it in GitHub Desktop.
React YouTube Viewer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useState } from 'react'; | |
| export const Search = props => { | |
| const [channelId, setChannelId] = useState(''); | |
| return ( | |
| <div> | |
| <div className="search"> | |
| <input type="text" onChange={event => setChannelId(event.target.value)} placeholder="Enter your favourite channel ID" /> | |
| <button disabled={!channelId.length} onClick={() => props.setCurrentChannelId(channelId)}>Get videos</button> | |
| </div> | |
| </div> | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment