export const autoScrollToTableLastRow = (tableRef, extraCustomHeight) => {
    let observer;
    if (tableRef.current) {
        const tableCurrent = tableRef.current;
        observer = new MutationObserver(() => {
            const requiredScrollHeight = tableCurrent.scrollHeight;
            tableCurrent.scrollTop = requiredScrollHeight + (extraCustomHeight || 0);
        });
        observer.observe(tableCurrent, { childList: true, subtree: true });
        const requiredScrollHeight = tableCurrent.scrollHeight;
        tableCurrent.scrollTop = requiredScrollHeight;
    }
    return () => {
        if (observer) {
            observer.disconnect();
        }
    };
};
//# sourceMappingURL=autoScrollToTableLastRow.js.map