Where should I request shopify data? Server side or client? #924
-
If I want to request some shopify data after a user action, should I request shopify data from API Routes by useFecther; or just fetching data at client? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hydrogen is built on Remix, and the Remix philosophy and general guidelines for data loading in Remix are to do as much as you can on the server. |
Beta Was this translation helpful? Give feedback.
-
Yes, prefer the server so that I can work without or while javascript is loading. Ideally use the Remix's Finally, call useActionData to read the data returned from the |
Beta Was this translation helpful? Give feedback.
Hydrogen is built on Remix, and the Remix philosophy and general guidelines for data loading in Remix are to do as much as you can on the server.