From 220457da6581dcc9e6fff4961ecc49cf9ec9ece8 Mon Sep 17 00:00:00 2001 From: Brent Vatne Date: Tue, 27 Aug 2019 10:47:32 -0700 Subject: [PATCH] fix: remove incorrect prop validation instance method and fix actual function --- packages/native/src/createAppContainer.js | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/packages/native/src/createAppContainer.js b/packages/native/src/createAppContainer.js index 13a0047b..0b9ca1c9 100644 --- a/packages/native/src/createAppContainer.js +++ b/packages/native/src/createAppContainer.js @@ -34,6 +34,7 @@ function validateProps(props) { screenProps, persistNavigationState, loadNavigationState, + theme, ...containerProps } = props; /* eslint-enable no-unused-vars */ @@ -142,28 +143,6 @@ export default function createNavigationContainer(Component) { return isStateful(this.props); } - _validateProps(props) { - if (this._isStateful()) { - return; - } - - // eslint-disable-next-line no-unused-vars - const { navigation, screenProps, theme, ...containerProps } = props; - - const keys = Object.keys(containerProps); - - if (keys.length !== 0) { - throw new Error( - 'This navigator has both navigation and container props, so it is ' + - `unclear if it should own its own state. Remove props: "${keys.join( - ', ' - )}" ` + - 'if the navigator should get its state from the navigation prop. If the ' + - 'navigator should maintain its own state, do not pass a navigation prop.' - ); - } - } - _handleOpenURL = ({ url }) => { const { enableURLHandling, uriPrefix } = this.props; if (enableURLHandling === false) {