Closed utterances-bot closed 1 year ago
Congratulations 🎉 !!! Your metaphor is first content on this community
If you would like to continue contributing to open source and would like to do it with an awesome inclusive community, you should join our GitHub Organisation - we help and encourage each other to contribute to open source little and often :neckbeard:. Any questions let us know.
Easy fetching on Next.js | SCP Metaphor
Metaphore Name Easy fetching on Next.js Share your metaphore story! Sometimes, we face fetching issue between development and production NODE_ENV.. Next.js need a canonical URL once you use SSR strategy, but it’s not required on local development. A quick utility could be: Create a config/index.tsx at the root of the project Add: const dev = process.env.NODE_ENV !== "production"; export const server = dev ? "http://localhost:3000" : "https://your_deployment.server.com"; And use this metaphore this way on SSR strategy pages: // src/pages/index.tsx import type { NextPage } from "next"; import Head from "next/head"; import React, { forwardRef, useEffect, useRef
https://streetcommunityprogrammer.github.io/metaphore/metaphore/stories/javascript/easy-fetching-on-nextjs/