-
Notifications
You must be signed in to change notification settings - Fork 335
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
Image add crossOrigin settings (#143) #324
Conversation
Please describe what your change is achieving / what problem this solves |
Oh I see this is for #143. Looks like you just made the changes in SVG, not Canvas |
Sorry, I forgot to change the canvas. It has been modified now. |
Hello, are there any questions about this PR? |
src/index.tsx
Outdated
@@ -344,6 +348,7 @@ const QRCodeCanvas = React.forwardRef(function QRCodeCanvas( | |||
setIsImageLoaded(true); | |||
}} | |||
ref={_image} | |||
crossOrigin={imageSettings?.crossOrigin ?? 'anonymous'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love that this is duplicating the work in getImageSettings
. I'd need to see if we can pull the call to that out of our useEffect
in here or maybe just pull the default setting out to ensure no potential drift.
I was playing around some more and unfortunately hit the one easy case where this is a problem: localhost out to the web (at least on my webserver which is used in the example code to fetch my favicon). Need to think about it a bit more. Defaulting to |
This ensures we have expected snapshots with values and that empty string maps to anonymous.
The same issue in antd: ant-design/ant-design#48759. |
No description provided.