How to find all child images of a ReactInstance

197 Views Asked by At

I'm the developer of react-to-print, a React component printing library. Currently, to ensure images exist on the page before I open the print window, I load all images on the page identified by document.querySelectorAll("img"). However, for pages with lots of images this gets slow, and often most of the images are not within the React component being printed anyways, so don't need to be loaded for printing at all. Given a ReactInstance, how would I go about identifying all img tags that exist within the instance and all of its children?

0

There are 0 best solutions below