Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access to Multigrid public method recomputeGridSize() returns undefined #1818

Open
DNikolic-Paycor opened this issue May 10, 2023 · 0 comments

Comments

@DNikolic-Paycor
Copy link

I am having issues to access recomputeGridSize() public method from Multigrid component with refs in React functional ccomponent.
I checked this issue #136 but solution from there does not work for me and i am still getting undefined.
In short hand my code looks something like this:
`
import { MultiGrid } from 'react-virtualized';

const SomeComponent=()=>{
const multiGridRef = useRef();
return (
<MultiGrid
onScroll={handleScroll}
width={headerRef?.current?.offsetWidth || 0}
height={multiGridHeight + 10}
fixedColumnCount={
stickyColumnsCount || stickyColumns.length
}
rowHeight={ROW_HEIGHT}
columnWidth={(index) =>
table.visibleColumns[index.index]?.totalFlexWidth || 0
}
cellRenderer={renderCell}
rowCount={table.rows.length}
columnCount={visibleColumnsCount}
ref={multiGridRef}
/>
);
}
`
If i console.log() multiGridRef?.current i will get:

conslosslls

I tried to access this method as multiGridRef.recomputeGridSize() and multiGridRef.current.recomputeGridSize() but both are undefined.
I really need help about this!
Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant