【发布时间】:2021-04-22 11:08:34
【问题描述】:
const mapStateToProps = (state) => ({ automaticRefreshEnabled: state.admin.ui.automaticRefreshEnabled });
我们如何将 automaticRefreshEnabled 更改为 false?
【问题讨论】:
标签: reactjs react-admin
const mapStateToProps = (state) => ({ automaticRefreshEnabled: state.admin.ui.automaticRefreshEnabled });
我们如何将 automaticRefreshEnabled 更改为 false?
【问题讨论】:
标签: reactjs react-admin
试试这个:
import { useDispatch } from 'react-redux'
import { setAutomaticRefresh } from 'react-admin'
...
const dispatch = useDispatch()
dispatch(setAutomaticRefresh(false))
【讨论】: