NextJS Notes: Difference between revisions

From bibbleWiki
Jump to navigation Jump to search
Created page with "=Introduction= This page is meant to capture parts of NextJS not covered by React =External Images= When using external images on a page you next to specify the allowed domains const nextConfig = { images: { remotePatterns: [ { protocol: "https", hostname: "images.unsplash.com", }, ], }, experimental: { serverActions: true, }, };"
 
Line 2: Line 2:
This page is meant to capture parts of NextJS not covered by React
This page is meant to capture parts of NextJS not covered by React
=External Images=
=External Images=
When using external images on a page you next to specify the allowed domains
When using external images on a page you next to specify the allowed domains in nextjs.config.js
 
<syntaxhighlight lang="js">


const nextConfig = {
const nextConfig = {
Line 18: Line 18:
     },
     },
   };
   };
</syntaxhighlight>

Revision as of 01:33, 7 October 2023

Introduction

This page is meant to capture parts of NextJS not covered by React

External Images

When using external images on a page you next to specify the allowed domains in nextjs.config.js

const nextConfig = {
    images: {
      remotePatterns: [
        {
          protocol: "https",
          hostname: "images.unsplash.com",
        },
      ],
    },
    experimental: {
      serverActions: true,
    },
  };