refetch() from child component

I createResource (with refetch option) in my parent component. I render a child component in this parent and want to call the parent's refetch(). Obviously, that doesn't work because refetch() isn't defined in the child. How can I trigger the parent's refetch() from the child component?
2 Replies
milomg
milomg2y ago
You can pass different functions using component props in SolidJS, perhaps by passing in refetchData={refetch} and then calling props.refetchData()
fragerdaz
fragerdazOP2y ago
Thanks, @modderme123 !
Want results from more Discord servers?
Add your server