diff --git a/src/main.js b/src/main.js index 9117481..7c96961 100644 --- a/src/main.js +++ b/src/main.js @@ -144,7 +144,9 @@ export default function milestones(selector) { }; const resizeObserver = new ResizeObserver(resizeHandler); - resizeObserver.observe(document.querySelector(selector)); + resizeObserver.observe( + typeof selector === 'string' ? document.querySelector(selector) : selector + ); function setAutoResize(d) { autoResize.current = d;