November 2019
Beginner
804 pages
20h 1m
English
Our SongsList component will be a dumb component. We now need to define and use its props.
We will pass two things to that component:
Go back to the songs-list.tsx file.
Change the Props interface to the following:
type Props = {
songs: FindSongs_songs[];
songSelected: (song: FindSongs_songs) => void;
};
And add the import:
import { FindSongs_songs } from '../generated/FindSongs';
Now that we have clearly stated our requirements, we can code assuming that we will get the expected inputs. Let's use the songs array to build the JSX elements to render.
Read now
Unlock full access