AIzaSyA_Ai0pJIyGMMfS8CIkiaRMkqxvJSVZTxM
npm install --save youtube-api-search
Is a component that is a function. Some info goes in and some jsx comes out.
Is a component that has some internal record keeping (state).
When the state of a component changes this component is immediattely rerendered, as well as the children
of this component.
means that only the most parent component should fetch data from a data source.
import YTSearch from 'youtube-api-search';
// how to use
YTSearch({
key: API_KEY,
term: 'Mellotron'
}, function(data) {
console.log(data);
});
if you convert a functional component to a class component then props
becomes this.props
.
this.props
is available to all functions in a class component.