In react-admin, All I know is that the framework provides two ways for me to update, they are setting dataProvider refresh to true and refreshbutton. Now my situation is that I have a dialog which used to pay. And the pay request is not restful api. So I have to use 'fetch'. And after pay, How can I refresh the current View to get lastest data?
Asked
Active
Viewed 856 times
2 Answers
1
please provide more details. Also, view is auto refreshed when state/prop is updated!
In rare cases, forceupdate() can be used

Gaurav Mithas
- 67
- 2
- 8
1
You can import and dispatch Redux action "refreshView" from 'ra-core', example: https://github.com/marmelab/react-admin/blob/master/packages/ra-ui-materialui/src/button/RefreshButton.js

MaxAlex
- 2,919
- 1
- 14
- 14
-
thx! refresh will return an action, What I do just to dispath it~ – holy zheng Dec 10 '19 at 11:42
-
@MaxAlex do you know where this have been moved to the new versions? – Joan Apr 20 '23 at 12:56
-
1@Joan React-Admin v4 no longer uses Redux, you can use the hook: https://marmelab.com/react-admin/useRefresh.html – MaxAlex Apr 21 '23 at 02:16