Closed ZeeCoder closed 4 years ago
One might have more than one hooks that need to operate on the same ref. In cases like that, it would be beneficial to allow passing an existing ref in, instead of this hook taking responsibility of creating one.
Pattern could be:
const [ref, width, height] = useResizeObserver(); // vs const [width, height] = useResizeObserver({ ref });
Need more thought and research on best practices on the topic.
One might have more than one hooks that need to operate on the same ref. In cases like that, it would be beneficial to allow passing an existing ref in, instead of this hook taking responsibility of creating one.
Pattern could be:
Need more thought and research on best practices on the topic.