Skip to content

Latest commit

 

History

History
40 lines (21 loc) · 1.48 KB

README.md

File metadata and controls

40 lines (21 loc) · 1.48 KB

Rick and Morty Character app

Rick and Morty

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?

  1. 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.

  1. I learnt how to use apollo client to pass a variable through the grapql query statement (App.js - line 127&128)

  2. Learnt that ReactNative refresh control does not work outside the FlatList component

  3. 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

🎉🎉 Clone repo and run on expo to take a look