const PostList = () => { const notify = useNotify(); const redirect = useRedirect(); const onError = (error) => { notify(`Could not load list: ${error.message}`, { type: 'error' }); redirect('/dashboard'); }; return ( <List queryOptions={{ onError }}> ... </List> ); }
行为的通知操作