i have a MUI dataGrid
component which i will be going to use in over one hundred components and i’m trying to write as much as code i can in this dataGrid
component to prevent over writing codes.
now i have faced one problem i can’t solve. I’ve imported dataGrid
component in a parent component. I’ve defined a fetchData
function in parent component, then passed it with props to dataGrid
component and set argument like pageSize
,filterModel
and etc in it. now i have a refresh button in my parent component that should invoke the fetchData with its argument from dataGrid component without trying to lifting State up or etc.
can i somehow link the refresh button with useRef
hook to fetchData
in dataGrid
component so when user clicked on the button , the fetch data with its arguments trigger