Skip to content

Instantly share code, notes, and snippets.

@codebubb
Created October 14, 2020 14:06
Show Gist options
  • Select an option

  • Save codebubb/b4455fb92b2159f836a11d1e0a68eac7 to your computer and use it in GitHub Desktop.

Select an option

Save codebubb/b4455fb92b2159f836a11d1e0a68eac7 to your computer and use it in GitHub Desktop.
React YouTube Viewer
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