Closed swisspix closed 4 years ago
export const Example = () => {
const [stackGrid, setStackGrid] = useState();
function handleUpdateLayout() {
if (stackGrid) {
stackGrid.updateLayout()
}
}
return (
<StackGrid
gridRef={grid => setStackGrid(grid)}
....
)
Hope this help
Hi !
I'm kind of new in react an discovered this awesome library but I really want to call the updateLayout function in a fonctional component !
How am I supposed to get the ref from the grid ?
I know it's like that in a class component gridRef={grid => this.grid = grid}
But how do I reference it in a fonctionnal component ?
Many thanks in advance :)