Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Image from next/Image all the time for all images. #686

Open
JayaKrishnaNamburu opened this issue May 31, 2022 · 1 comment · May be fixed by #696
Open

Using Image from next/Image all the time for all images. #686

JayaKrishnaNamburu opened this issue May 31, 2022 · 1 comment · May be fixed by #696
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@JayaKrishnaNamburu
Copy link
Member

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

@JayaKrishnaNamburu JayaKrishnaNamburu added enhancement New feature or request help wanted Extra attention is needed labels May 31, 2022
@JayaKrishnaNamburu
Copy link
Member Author

NextJS released a new update for the Image component. Probably we should look into that, it has better flexibility with styling.
https://next-site-git-nextjs-12-2-blog.vercel.sh/docs/api-reference/next/future/image

@JayaKrishnaNamburu JayaKrishnaNamburu changed the title Using Image from `next/Image all the time for all images. Using Image from next/Image all the time for all images. Jul 19, 2022
@JayaKrishnaNamburu JayaKrishnaNamburu self-assigned this Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant