4

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?

holy zheng
  • 81
  • 5

2 Answers2

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