Code Monkey home page Code Monkey logo

Comments (2)

ryansolid avatar ryansolid commented on June 9, 2024

This is an odd one in that we skip innerHTML on hydration altogether. Or rather we should be. And it doesn't use JSX so no hydration IDs. It shouldn't have any bearing on hydration even if we didn't,.... unless the insert on the server is the problem and it produces malformed HTML.

I do remember from my research on omitting tags some tags had really weird rules and <a> were on a list I had to always close otherwise they produce really weird behavior, like looking for the next <a> or something like that. I think I actually see it in your demo, the hello world becomes underlined for a moment suggesting it is a link before the hydration error pops up.

Yeah basically any loose text after it becomes wrapped in <a href="example.com"></a>. So while over the wire the only difference between including and not including the closing tag is the missing </a>, the browser heals it in a way that inserts a bunch of extra anchor tags before we ever have a chance to hydrate.

Long story short close your anchor tags, as native browser behavior is odd. I recommend closing tags in general unless you are comfortable with being aware of all the weird behaviors that happen when you don't.

from solid-start.

indeyets avatar indeyets commented on June 9, 2024

@ryansolid is there any chance to get a controllable error in this case? that would be fine with me.

my use-case involves input from a third-party system. and while I can validate what I get to the certain degree, I can't be 100% sure that I did it properly.

So, I need a way to handle this issue at this exact location. I'm fine with showing an error message instead of the block or even with hiding this block altogether. But I need my app to keep working otherwise

from solid-start.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.