Refresh
<RefreshButton> uses Material UI <Button> component to update the data shown on the page via the useInvalidate hook.
You can swizzle this component with the Refine CLI to customize it.
Usage​
Properties​
recordItemId​
recordItemId allows us to manage which data is going to be refreshed. By default, the recordItemId is inferred from the route params.
Clicking the button will trigger the useInvalidate hook and then fetch the record whose resource is "post" and whose id is "123".
resource​
resource allows us to manage which resource is going to be refreshed. By default, the resource is inferred from the route params.
Clicking the button will trigger the useInvalidate hook and then fetches the record whose resource is "categories" and whose id is "2".
If you have multiple resources with the same name, you can pass the identifier instead of the name of the resource. It will only be used as the main matching key for the resource, data provider methods will still work with the name of the resource defined in the <Refine/> component.
For more information, refer to the
identifiersection of the<Refine/>component documentation →
hideText​
hideText is used to show and hide the text of the button. When true, only the button icon is visible.
API Reference​
Properties​
| Property | Type | Description | Default |
|---|---|---|---|
hideText | | Whether should hide the text and show only the icon or not. | |
resource | | Resource name for API data interactions. | Inferred resource name from the route |
accessControl | | Access Control configuration for the button |
|
recordItemId | Data item identifier for the actions with the API | Reads | |
dataProviderName | | ||
onClick | | Sets the handler to handle click event | |
svgIconProps | |
It also accepts all props of Material UI Button.