Menu
Recoil 中文网中文文档博客
GitHub英文官网
Recoil 中文网
  • 中文文档
  • 博客
  • GitHub
  • 英文官网
  • 简介
    • 动机
    • 核心概念
    • 安装 Recoil
    • 快速入门
  • 基础教程
    • Intro
    • Atoms
    • Selectors
  • 学习指南
    • Asynchronous Data Queries
    • Asynchronous State Sync
    • State Persistence
  • API 参考手册
    • 核心
      • <RecoilRoot />
      • State
        • atom()
        • selector()
        • Loadable
        • useRecoilState()
        • useRecoilValue()
        • useSetRecoilState()
        • useResetRecoilState()
        • useRecoilValueLoadable()
        • useRecoilStateLoadable()
        • isRecoilValue()
      • Snapshots
        • Snapshot
        • useRecoilTransactionObserver()
        • useRecoilSnapshot()
        • useGotoRecoilSnapshot()
      • useRecoilCallback()
      • Misc
        • useRecoilBridgeAcrossReactRoots()
    • 工具
      • atomFamily()
      • selectorFamily()
      • constSelector()
      • errorSelector()
      • waitForAll()
      • waitForAny()
      • waitForNone()
      • noWait()

errorSelector(message)

A selector which always throws the provided error

function errorSelector(message: string): RecoilValueReadOnly

#Example

const myAtom = atom({
key: 'My Atom',
default: errorSelector('Attempt to use Atom before initialization'),
});
Edit this page
Previous
« constSelector(constant)
Next
waitForAll(dependencies) »
  • Example

学习

  • 快速入门
  • 核心概念

社区

  • Twitter

更多

  • GitHub

Legal

  • Privacy
  • Terms

友链

  • Bootstrap中文网
  • React
  • Redux
  • Next.js
Facebook Open Source Logo
Copyright © 2020 Facebook, Inc. Built with Docusaurus.
Recoil 项目及相关资源的版权归 Facebook 或项目贡献者所有
Recoil 中文文档遵循 MIT 开源协议
京ICP备15031610号-40