Skip to content

UseSWR not returning data from api routes #676

Answered by sergiodxa
darrylmorley asked this question in Q&A
Discussion options

You must be logged in to vote

Because you are not adding a return at the end of your if condition, the rest of the code it's being executed. You need to either return inside the if or wrap the rest of the code in an else.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@darrylmorley
Comment options

Answer selected by darrylmorley
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants