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.io – build remarkable experiences at scale

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

Categorized in