问题描述
const mapStatetoProps = (state) => ({ automaticRefreshEnabled: state.admin.ui.automaticRefreshEnabled });
如何将automaticRefreshEnabled 改为false?
解决方法
试试这个:
import { useDispatch } from 'react-redux'
import { setAutomaticRefresh } from 'react-admin'
...
const dispatch = useDispatch()
dispatch(setAutomaticRefresh(false))