({ children, render }: IObserverProps)
| 8 | } |
| 9 | |
| 10 | function 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 | } |
| 22 | if ("production" !== process.env.NODE_ENV) { |
| 23 | ObserverComponent.propTypes = { |
| 24 | children: ObserverPropsCheck, |
nothing calls this directly
no test coverage detected
searching dependent graphs…