📆 Don't miss our Sanity Showcase virtual meetup on March 20th!

Migrating from React to Next.js and React - ESLint and Next.Config.js Issues

2 replies
Last updated: Mar 2, 2022
I’m moving my portfolio site from React to NextJS + React using this tutorial 👈
Two questions:

• Eslint is screaming at me, do you recommend to change
<img/>
by
<Image/>
using
import Image from "next/image";
?• Seems like I need to edit the
next.config.js to male
next/image
works but I’m not sure if I’m doing this right! ◦ By default comes like this
module.exports = nextConfig;
◦ The guide is telling me I need to add the domain like
module.exports = {images: {domains: ["<http://cdn.sanity.io|cdn.sanity.io>"], },};
▪︎ But I don’t have any clue where to leave the
= nextConfig;
or if I need to..Many thanks for your time!
Mar 2, 2022, 2:53 AM
Eslint is screaming at me
Yeah it’s good to use some sort of smart (sizing, lazyloading, etc.) image component. Haven’t used it recently but this library may help you get setup: https://www.npmjs.com/package/next-sanity-image

But I don’t have any clue where to leave the
= nextConfig;
or if I need to..
You don’t need it 👍
Mar 2, 2022, 3:27 AM
thank you so much
user J
!! I really appreciated 🙏
Mar 2, 2022, 3:37 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?

Related answers

Get more help in the community Slack

TopicCategoriesFeaturedRepliesLast Updated
How to turn PortableText into plain text in Javascript?Dec 7, 2020
Deploying Next JS on VercelJan 20, 2021
Rendering nested block contentJan 18, 2021
DOMParser is not defined at defaultParseHtmlDec 3, 2020
Warning: Data for Page Exceeds the Threshold of 128 kBAug 17, 2022
Custom Document Views - Is it Even Possible to Use the Structure Builder?Apr 21, 2022
Error in Next.js tutorial with event handlers in server components.Feb 28, 2024
How to populate a list of values in a Sanity schema using a separate fileSep 6, 2021
How to fetch an array of images using groq in Sanity.ioMay 21, 2023
Discussion about the root layout for a website and how to properly implement it using Next.js.Apr 4, 2024

Related contributions

Turbo Start Sanity
- Template

The battle-tested Sanity template that powers Roboto Studio's websites

Go to Turbo Start Sanity

Schema UI - Next.js Sanity Starter
- Template

A Next.js starter template with Next.js 15, Tailwind CSS, shadcn/ui, and Sanity CMS with Live Editing. Get production-ready React components with matching Sanity schemas and queries. Build dynamic pages faster while keeping full control over customization.

Serge Ovcharenko
Go to Schema UI - Next.js Sanity Starter

The Swaddle
- Made with Sanity

A new brand identity to represent a more mature company, to signify The Swaddle’s evolution from publisher to production house, combined with an easier to navigate platform that can surface multiple content types - drawing readers through The Swaddle’s content offering.

Nightjar
Go to The Swaddle