首页 > 解决方案 > 如何在反应管理员中禁用自动刷新启用标志?

问题描述

const mapStateToProps = (state) => ({ automaticRefreshEnabled: state.admin.ui.automaticRefreshEnabled });

我们如何将 automaticRefreshEnabled 更改为 false?

标签: reactjsreact-admin

解决方案


尝试这个:

import { useDispatch } from 'react-redux'
import { setAutomaticRefresh } from 'react-admin'
...
const dispatch = useDispatch()                         
dispatch(setAutomaticRefresh(false))

推荐阅读