Closed ChrisJohnson-83 closed 4 years ago
Thanks for the issue! Yes, morphdom can be a good candidate for patching DOM at any level. You just need to make sure what you are patching is at the same level - So the first and second arguments are at the same level in the DOM tree. With targetId
, I imagine you could accomplish what you are looking for! Feel free to put more detailed comments and if we can direct your implementation.
Apologies if this question is too simplistic, I am just trying to understand if Morphdom would be a good use case for my scenario.
I have server rendered HTML which is returned in a promise from a Javascript Fetch API request. Sometimes the returned HTML contains only the portion that needs to be replaced in the DOM but sometimes it contains HTML which doesn't need to be replaced. Currently I update the DOM like this:
Could this be a good use case for Morphdom instead? Does Morphdom have the capability to allow me to do a more intelligent DOM replacement?