-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Uncaught error when doing dangerouslySetInnerHTML="<svg>...</svg>" #194
Comments
@callumlocke what version of Preact are you seeing this with? There should be no Dom property reads anymore in 5.x ( |
I'm using 4. Will give 5.beta a try, thanks. Are there any gotchas for me to be aware of when upgrading to 5? do I also need to upgrade preact-compat? |
Nope, should just be a ton faster and a little smaller :) There are no backwards-incompatible changes in Preact 5, only a bunch of additional features - the major version bump is just to mark those new features, so that code depending on them has a way to indicate that it won't work with Preact As long as you're running a reasonably recent |
With npm 2, I get a fatal EPEERINVALID when trying to install preact@beta, because preact-compat peer-depends on preact@4. Is there a workaround for that (assuming I can't upgrade to npm3)? |
Ah - I've been using npm 3 for so long I forgot about that. I'll throw a |
If you could do that soon, that would be awesome! |
Will do, I actually found an svg issue when combining preact 5 with preact-compat that I was fixing last night. It's waiting on a decision about whether to bundle svg support into preact itself. I can just publish the -compat version thing though, will do that right away. |
@callumlocke Sorry for the wait there (painting a bedroom) - I just published |
damn, it seems like [email protected]'s peer-dep semver range ( |
Weird... maybe it was because I unpublished and republished? Should be at |
I think I can confirm this seems to be fixed in 5.x: Also a note: I just published |
From developit/microbundle_error
Add encodeEntities fast path for inputs that don't need anything replaced
When my
dangerouslySetInnerHTML
string includes an inline SVG, it renders fine the first time, but when it re-renders I get uncaught errors:I'm guessing this is to do with the fact that inline SVGs require a special module, preact-svg..? But I'm not sure how that can work for my use case, because my SVG is entirely inside the string I am trying to 'dangerously inject'.
Any idea how I can fix this?
The text was updated successfully, but these errors were encountered: