diff --git a/packages/mobx-react-lite/src/ObserverComponent.ts b/packages/mobx-react-lite/src/ObserverComponent.ts index 5b0dc599b..b3875300b 100644 --- a/packages/mobx-react-lite/src/ObserverComponent.ts +++ b/packages/mobx-react-lite/src/ObserverComponent.ts @@ -6,6 +6,11 @@ interface IObserverProps { } function ObserverComponent({ children, render }: IObserverProps) { + if (children && render) { + console.error( + "MobX Observer: Do not use children and render in the same time in `Observer`" + ) + } const component = children || render if (typeof component !== "function") { return null