SWR with Expo #733
Answered
by
promer94
crismarucci
asked this question in
Q&A
SWR with Expo
#733
Replies: 2 comments 5 replies
-
@crismarucci could you help provide few stack traces for the errors you saw? are you trying to play swr with React Native? |
Beta Was this translation helpful? Give feedback.
4 replies
-
const fetcher = (url) => {
// miss return statement here
return axios.get(url)
.then((response) => {
console.log(response)
return response.data.results.json()
})
.catch(function (error) {
let textError = ""
if (error.response) {
textError = error.response.data.message
} else if (error.request) {
textError = error.request
} else {
textError = error.message
}
const errorThw = new Error(textError)
errorThw.message = textError
errorThw.info = error
errorThw.status = error.status
return errorThw
})
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
crismarucci
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I'm a newbie with SWR. I'm getting a lot of errors in my app while trying to make it work... but I'm asking myself if this library works with Expo? Tks for your help.
Beta Was this translation helpful? Give feedback.
All reactions