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

After rewriting the img components, each rolling of the page will cause Image to reload, and the page flickering #881

Closed
4 tasks done
QiaoLi1996 opened this issue Dec 27, 2024 · 3 comments
Labels
🙋 no/question This does not need any changes 👎 phase/no Post cannot or will not be acted on

Comments

@QiaoLi1996
Copy link

Initial checklist

Affected package

"react-markdown": "^9.0.1", "next": "15.0.4-canary.31",

Steps to reproduce

I need to add attributes Crossorigin = "Anonymous" to support the cross -domain of image resources. I did not find a good method, so I rewritten IMG components. As shown below:

 components={{
                img({ src, alt }) {
                    return <img src={src} alt={alt} crossOrigin="anonymous" />
                },
            }}

Then the error happened

Actual behavior

Each rolling of the page will cause Image to reload, and the page flickering.
But the default behavior is normal, remove the iMage rewriting code to return to normal.

Expected behavior

After rewriting the img components, each rolling of the page not reload the image

Runtime

No response

Package manager

No response

Operating system

No response

Build and bundle tools

No response

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Dec 27, 2024
@remcohaszing
Copy link
Member

You should define the img component outside of any other components

@remcohaszing remcohaszing closed this as not planned Won't fix, can't repro, duplicate, stale Dec 27, 2024

This comment has been minimized.

@remcohaszing remcohaszing added 🙋 no/question This does not need any changes 👎 phase/no Post cannot or will not be acted on labels Dec 27, 2024
@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Dec 27, 2024
Copy link

Hi! Thanks for reaching out! Because we treat issues as our backlog, we close issues that are questions since they don’t represent a task to be completed.

See our support docs for how and where to ask questions.

Thanks,
— bb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 no/question This does not need any changes 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

2 participants