So I did a quick project with the rick and morty API here using apollo client to consume a graphql API with this
What did I learn?
- I learnt that when using FlatLists in react native the object returned from the renderItem prop is an object with two properties item and index, and the only way to change it is to use this (check line 191 in App.js)
renderItem={({ item:new_name, index }) => <EpisodeItem episode={new_name.episode} airdate={new_name.air_date} name={new_name.name} />}
otherwise you must use it the way it was
renderItem={({ item, index }) => <EpisodeItem episode={item.episode} airdate={item.air_date} name={item.name} />}
This was the most eye opening frustration of the day.
-
I learnt how to use apollo client to pass a variable through the grapql query statement (App.js - line 127&128)
-
Learnt that ReactNative refresh control does not work outside the FlatList component
-
Attempted to use the FluidNavigation to transition between screens and it didnt work, i tried thier examples, they also didnt work, looks like a dependency was removed from somewhere inside