Open devcer opened 4 years ago
Hi @devcer, can I take this issue? Here is some question for this issue, what data should be get from the external JSON file, and what data should be get from HTTP fetch? Do you have a preferable API to get the data? or i free to choose what API that will be used. Thanks!
@bmusuko
https://github.com/devcer/CapShun/blob/master/src/constants/MockData.ts
https://github.com/devcer/CapShun/blob/master/src/screens/HomeScreen.tsx#L10
to name a few. I would like to move them to external JSON files(probably in the src/assets/data
folder(create data
folder if it doesn't exist). Am I clear?
yeah pretty clear, can you assign it to me? @devcer
turns out you can't fetch() json file locally with expo https://github.com/expo/expo/issues/9098#issuecomment-654273498. I already refactor it to external json file. Is it okay to just use normal import json? @devcer
@bmusuko I see we could use fetch. Not sure though for local files. -> https://docs.expo.io/versions/v36.0.0/react-native/network/ Let me try out for one JSON, so that you could do the same for the rest.
@bmusuko I see that I cannot use fetch to get static files. Please go ahead and use normal import json. Assigning this to youl.
Currently static data like captions, moods, tags. etc. are either in
.ts
files or inline code.This will enable us to directly connect with REST APIs in the later stages.