Skip to content

Add next/image component as MDX component and convert img tags to Image component #4382

Description

@harish-sethuraman

There are a lot of images inside markdown that are either img tags or markdown images. Need to use next/image component instead of img tags and markdown images.

Edit: These changes are needed for beta.reactjs.org site

Activity

  1. gaearon commented on Feb 25, 2022

    @gaearon
    Member

    Ideally we'd keep markdown syntax for images. Something like this maybe? https://kylepfromer.com/blog/nextjs-image-component-blog

  2. harish-sethuraman commented on Feb 25, 2022

    @harish-sethuraman
    CollaboratorAuthor

    Sounds good we can try the same

  3. seriseri-55 commented on May 7, 2022

    @seriseri-55

    I was interested in making PR for this and wondering why we would use next/image component instead of something like this.
    https://www.gatsbyjs.com/plugins/gatsby-plugin-image/#using-the-gatsby-image-components

  4. harish-sethuraman commented on May 7, 2022

    @harish-sethuraman
    CollaboratorAuthor

    Hey @KazuyaSerizawa the beta.reactjs.org site uses nextjs that is why we are trying to use next/image for it.

  5. Anishpras commented on May 29, 2022

    @Anishpras

    Hey @gaearon and @harish-sethuraman Can I work on this issue?

  6. harish-sethuraman commented on May 29, 2022

    @harish-sethuraman
    CollaboratorAuthor

    Feel free to send PR

  7. yashbujji commented on Jun 12, 2022

    @yashbujji

    is there anyone working on this issue or can i take this?

  8. Dev79844 commented on Jun 17, 2022

    @Dev79844

    I am interested in solving this issue.

  9. harish-sethuraman commented on Jun 17, 2022

    @harish-sethuraman
    CollaboratorAuthor

    If you are working on this. Send a PR and we can take it on from there

  10. siddhsuresh commented on Sep 18, 2022

    @siddhsuresh

    @harish-sethuraman could I work on this and submit a PR?

  11. harish-sethuraman commented on Sep 18, 2022

    @harish-sethuraman
    CollaboratorAuthor

    Sure go ahead.

  12. thomasgilmore commented on Oct 4, 2022

    @thomasgilmore

    @harish-sethuraman not sure if anyone is still working on this, but could I work on this?

  13. harish-sethuraman commented on Oct 4, 2022

    @harish-sethuraman
    CollaboratorAuthor

    Sure go ahead.

  14. ShivamPandey00 commented on Feb 14, 2023

    @ShivamPandey00

    hey @harish-sethuraman.. is anyone working on this issue.
    i think i can resolve this issue.

  15. Gua00va commented on Feb 15, 2023

    @Gua00va

    Hey!! I want to work on this issue. I'm new here so I'm really excited to start contributing. Please assign it to me.

  16. Andres-Ventura commented on Feb 19, 2023

    @Andres-Ventura

    Geez just assign somebody already lol

  17. ashutosh887 commented on Mar 19, 2023

    @ashutosh887

    @harish-sethuraman I would like to work on this if the PRs are not accepted. Please clarify

  18. ashutosh887 commented on Apr 26, 2023

    @ashutosh887

    @harish-sethuraman Should I work on this?

  19. Aayush895 commented on May 17, 2023

    @Aayush895

    Hi, I just finished setting up the app locally and I did not understand the problem quite clearly. I am new to open source so any form of help will be appreciated. From the problem statement, I am assuming that the 'img' element in MDXComponents file has to be converted into an Image component right? Correct me if I am wrong

  20. Aayush895 commented on May 17, 2023

    @Aayush895

    Hi, I just finished setting up the app locally and I did not understand the problem quite clearly. I am new to open source so any form of help will be appreciated. From the problem statement, I am assuming that the 'img' element in MDXComponents file has to be converted into an Image component right? Correct me if I am wrong

    If you can direct me to a particular folder/file that will be highly appreciated, thanks

  21. ashutosh887 commented on Aug 18, 2023

    @ashutosh887

    @harish-sethuraman @gaearon
    let me work on this if still not resolved... Please assign

  22. remcohaszing commented on Mar 21, 2025

    @remcohaszing

    If you use @next/mdx with rehype-mdx-import-media, it’ll just work™. This would also provide better compatibility with other MDX features, such as editor support.

    The reason I’m not PRing this, is because requires some quite impactful changes. For example, MDX files should use the .mdx file extension, not .md.

  23. vishpatel30 commented on Dec 16, 2025

    @vishpatel30

    Will like to work on thiis issue

  24. wdev6666 commented on Mar 27, 2026

    @wdev6666

    Hi @harish-sethuraman I’d like to work on this issue. Could you please assign it to me?

  25. devtunis commented on Mar 28, 2026

    @devtunis

    Hi everyone 👋

    I’ve gone through the discussion and existing PR attempts, and I’d like to take this on.

    My approach would be:

    • Add next/image as an MDX component
    • Map existing <img> and markdown images to the Image component
    • Ensure compatibility with current MDX setup without breaking existing content

    I’ll start by exploring the MDX components setup and propose a clean, minimal-change solution.

    Please let me know if there are any constraints or preferred approaches before I begin 🚀

  26. Riya61018 commented on May 16, 2026

    @Riya61018

    Hello everyone
    I would like to contribute in this issue
    is anyone else working on it?
    can i help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions