Skip to content

import NextImage from 'next/image' #298

Answered by timlrx
rsipakov asked this question in Q&A
Discussion options

You must be logged in to vote

That's because in the subsequent line we are defining a new image component const Image = ({ ...rest }) => <NextImage {...rest} /> and there would be a clash in the names if the import was also called Image.

As to why there is this additional level of abstraction, it's mainly to facilitate those trying to create a static build since they can swap out NextImage for img.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rsipakov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants