Right now, we are using next/image only if the user specifies width and height alone without any additional attributes. This is because, next/Image is not completely pure component at the moment. Because it is bringing some side effects tot he layout with it. Since we can't pass the styles that users set into the component.
https://github.com/teleporthq/teleport-code-generators/blob/development/packages/teleport-plugin-jsx-next-image/src/index.ts#L11
Here is the issue on the NextJS GitHub on the same topic
vercel/next.js#18312
Case 1
It is not working out of the box all the time, since we allow users to free-style on the properties they use for the images. But the next/image need to be used with some constraints
Usual - https://codesandbox.io/s/pf9mt4
next/Image - https://codesandbox.io/s/travel-agency-forked-h28f9p
Right now, we are using
next/imageonly if the user specifieswidthandheightalone without any additional attributes. This is because,next/Imageis not completely pure component at the moment. Because it is bringing some side effects tot he layout with it. Since we can't pass thestylesthat users set into the component.https://github.com/teleporthq/teleport-code-generators/blob/development/packages/teleport-plugin-jsx-next-image/src/index.ts#L11
Here is the issue on the
NextJSGitHub on the same topicvercel/next.js#18312
Case 1
It is not working out of the box all the time, since we allow users to free-style on the properties they use for the images. But the
next/imageneed to be used with some constraintsUsual - https://codesandbox.io/s/pf9mt4
next/Image - https://codesandbox.io/s/travel-agency-forked-h28f9p