Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In react-admin, how can i update my current view when i using fetch to get data?

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?

like image 663
holy zheng Avatar asked Sep 13 '25 00:09

holy zheng


1 Answers

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

like image 166
MaxAlex Avatar answered Sep 15 '25 13:09

MaxAlex