2.7.5
After making the change to include all DOM nodes in the snapshot (instead of using the returned node) led to it being a lot harder to control the width of the snapshot. If you use React, you probably use ReactDOM.render to render the happo example into the DOM. This usually involves creating an anonymous div that you append to the <body>. Without some clever css styling in order to make this anonymous div the right size, you'll end up with full-width snapshots. To fix that, we've added a getRootNodes function that you can use to control what nodes are used to compute the bounding rectangle.
Here's an example for React:
happo.getRootNodes = function() {
return document.querySelectorAll('[data-reactroot]');
};
You can return a NodeList or an Array from this function.