Closed edbras closed 7 years ago
) as it will only parse HTML rendered before it. How does this look if it concerns a html snippet that is downloaded from the backend API? In case of a SPA (Single Page App), it happens that you replace/add/remove html parts on a screen. I like to parse a html part that will contain a root div and many nested html elements. How should I parse this such that habitat will add the required components?
In pseude-code:
htmlSnippet = retrieveFromBackend();
parseWithHabitat(htmlSnippet); (??)
Any update on this issue ? Thanks, Ed
Hi Ed,
Thanks for your follow up question. For future reference, when a Github issue is closed. You can actually still comment on it and it can be reopened if need be. This helps keep the conversation in one place which benefits 3rd part readers.
With regards to your pseude-code. That is not how React Habitat works. React Habitat is never given HTML to parse. Instead it reads the HTML from the page it is included on. The concept is nothing new and similar to how a jQuery selector might work. I suggest reaching out to your local developer network to help explain this framework, its examples and my original answers to you. I also encourage you to look through the source code to see how it works.
Thanks, Jenna
Thanks for the update. I will further look at your code on how to use it, like the method "parseContainer" you did send before.
Thanks for your answers.