MCPcopy Index your code
hub / github.com/mobxjs/mobx / ObserverComponent

Function ObserverComponent

packages/mobx-react-lite/src/ObserverComponent.ts:10–21  ·  view source on GitHub ↗
({ children, render }: IObserverProps)

Source from the content-addressed store, hash-verified

8}
9
10function ObserverComponent({ children, render }: IObserverProps) {
11 if (children && render) {
12 console.error(
13 "MobX Observer: Do not use children and render in the same time in `Observer`"
14 )
15 }
16 const component = children || render
17 if (typeof component !== "function") {
18 return null
19 }
20 return useObserver(component)
21}
22if ("production" !== process.env.NODE_ENV) {
23 ObserverComponent.propTypes = {
24 children: ObserverPropsCheck,

Callers

nothing calls this directly

Calls 1

useObserverFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…