0

We have a Node.js server doing some HTML scraping (looking for images). Right now we use the Cheerio NPM module to create a virtual DOM from the HTML we retrieve from requests and then traverse with jQuery on the server.

However I was wondering if there is a way to do this with React since it does serverside rendering. Is React able to create a traversable virtual DOM from an HTML string?

Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
  • 2
    I don't see how this would work. React *writes* HTML, it doesn't read it. React's so-called virtual DOM is an internal detail, not something it exposes. – David L. Walsh Dec 16 '15 at 02:50
  • but it could virtualize the HTMLinto a virtual DOM just like it does with the real DOM...I dont think React does this OOTB...but I think there are addons that do it – Alexander Mills Dec 16 '15 at 05:13

0 Answers0