fateh999 / react-native-paper-dropdown

Dropdown using react native paper TextInput and Menu
MIT License
130 stars 74 forks source link

Does not work with babel config in package.json #45

Closed juliushuck closed 1 month ago

juliushuck commented 2 years ago

I created a new expo project and installed react-native-paper and react-native-paper-dropdown. I then added the react-native-paper/babel plugin to the babel config. To test the package, I copied the demo code of this package into the App.js file and everything worked like expected.

But when i copy the babel config into the package.json file, i always get the following errors and the dropdowns do not open.

On the normal dropdown, I get a warning.

Screen Shot 2021-11-06 at 02 13 26

Error Error: EISDIR: illegal operation on a directory, read at Object.readSync (node:fs:723:3) at tryReadSync (node:fs:433:20) at Object.readFileSync (node:fs:479:19) at UnableToResolveError.buildCodeFrameMessage (/Users/huckjulius/Projects/Test/my-app/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:347:17) at new UnableToResolveError (/Users/huckjulius/Projects/Test/my-app/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:333:35) at ModuleResolver.resolveDependency (/Users/huckjulius/Projects/Test/my-app/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:211:15) at DependencyGraph.resolveDependency (/Users/huckjulius/Projects/Test/my-app/node_modules/metro/src/node-haste/DependencyGraph.js:413:43) at /Users/huckjulius/Projects/Test/my-app/node_modules/metro/src/lib/transformHelpers.js:317:42 at /Users/huckjulius/Projects/Test/my-app/node_modules/metro/src/Server.js:1471:14 at Generator.next () [Unhandled promise rejection: Error: Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`.] at https://callstack.github.io/react-native-paper/getting-started.html:null in at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:136855:25 in checkManager at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:136825:33 in componentDidMount$ at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:27124:22 in tryCatch at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:27294:31 in invoke at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:27124:22 in tryCatch at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:27196:29 in invoke at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:27226:18 in at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:31984:8 in tryCallTwo at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:32148:24 in doResolve at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:32007:13 in Promise at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:27225:32 in callInvokeWithMethodAndArg at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:27230:156 in enqueue at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:27245:68 in at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:136821:41 in componentDidMount at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:21280:46 in commitLifeCycles at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:23316:28 in commitLayoutEffects at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:9898:20 in invokeGuardedCallbackProd at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:10002:41 in invokeGuardedCallback at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:23098:35 in commitRootImpl at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:56909:29 in unstable_runWithPriority at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:22986:23 in commitRoot at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:22530:18 in performSyncWorkOnRoot at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:13775:39 in at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:56909:29 in unstable_runWithPriority at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:13770:29 in flushSyncCallbackQueueImpl at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:13759:34 in flushSyncCallbackQueue at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:22546:34 in batchedUpdates$1 at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:11337:35 in batchedUpdates at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:11429:22 in _receiveRootNodeIDEvent at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:11483:33 in receiveTouches at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:3749:35 in __callFunction at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:3477:30 in at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:3703:14 in __guard at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:3476:20 in callFunctionReturnFlushedQueue

On the multiselect dropdown, I get an error.

Screen Shot 2021-11-06 at 02 14 00

Error Error: Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`. Please read our getting-started guide and make sure you've followed all the required steps. https://callstack.github.io/react-native-paper/getting-started.html This error is located at: in PortalConsumer in Portal in ThemedComponent (created by withTheme(Portal)) in withTheme(Portal) (created by Menu) in RCTView (created by View) in View (created by Menu) in Menu in ThemedComponent (created by withTheme(Menu)) in withTheme(Menu) in Unknown (created by App) in RCTSafeAreaView in SafeAreaView (created by App) in RCTView (created by View) in View (created by AnimatedComponent) in AnimatedComponent in AnimatedComponentWrapper (created by Surface) in Surface in ThemedComponent (created by withTheme(Surface)) in withTheme(Surface) (created by App) in ThemeProvider (created by App) in ThemeProvider (created by Provider) in RCTView (created by View) in View (created by Portal.Host) in Portal.Host (created by Provider) in Provider (created by App) in App (created by ExpoRoot) in ExpoRoot in RCTView (created by View) in View (created by AppContainer) in DevAppContainer (created by AppContainer) in RCTView (created by View) in View (created by AppContainer) in AppContainer at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException at node_modules/react-native/Libraries/Core/ReactFiberErrorDialog.js:43:2 in showErrorDialog Error: Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`. Please read our getting-started guide and make sure you've followed all the required steps. https://callstack.github.io/react-native-paper/getting-started.html This error is located at: in PortalConsumer in Portal in ThemedComponent (created by withTheme(Portal)) in withTheme(Portal) (created by Menu) in RCTView (created by View) in View (created by Menu) in Menu in ThemedComponent (created by withTheme(Menu)) in withTheme(Menu) in Unknown (created by App) in RCTSafeAreaView in SafeAreaView (created by App) in RCTView (created by View) in View (created by AnimatedComponent) in AnimatedComponent in AnimatedComponentWrapper (created by Surface) in Surface in ThemedComponent (created by withTheme(Surface)) in withTheme(Surface) (created by App) in ThemeProvider (created by App) in ThemeProvider (created by Provider) in RCTView (created by View) in View (created by Portal.Host) in Portal.Host (created by Provider) in Provider (created by App) in App (created by ExpoRoot) in ExpoRoot in RCTView (created by View) in View (created by AppContainer) in DevAppContainer (created by AppContainer) in RCTView (created by View) in View (created by AppContainer) in AppContainer at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException at node_modules/react-native/Libraries/Core/ReactFiberErrorDialog.js:43:2 in showErrorDialog Error: Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`. Please read our getting-started guide and make sure you've followed all the required steps. https://callstack.github.io/react-native-paper/getting-started.html This error is located at: in PortalConsumer in Portal in ThemedComponent (created by withTheme(Portal)) in withTheme(Portal) (created by Menu) in RCTView (created by View) in View (created by Menu) in Menu in ThemedComponent (created by withTheme(Menu)) in withTheme(Menu) in Unknown (created by App) in RCTSafeAreaView in SafeAreaView (created by App) in RCTView (created by View) in View (created by AnimatedComponent) in AnimatedComponent in AnimatedComponentWrapper (created by Surface) in Surface in ThemedComponent (created by withTheme(Surface)) in withTheme(Surface) (created by App) in ThemeProvider (created by App) in ThemeProvider (created by Provider) in RCTView (created by View) in View (created by Portal.Host) in Portal.Host (created by Provider) in Provider (created by App) in App (created by ExpoRoot) in ExpoRoot in RCTView (created by View) in View (created by AppContainer) in DevAppContainer (created by AppContainer) in RCTView (created by View) in View (created by AppContainer) in AppContainer at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException at node_modules/react-native/Libraries/Core/ReactFiberErrorDialog.js:43:2 in showErrorDialog Error: Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`. Please read our getting-started guide and make sure you've followed all the required steps. https://callstack.github.io/react-native-paper/getting-started.html This error is located at: in PortalConsumer in Portal in ThemedComponent (created by withTheme(Portal)) in withTheme(Portal) (created by Menu) in RCTView (created by View) in View (created by Menu) in Menu in ThemedComponent (created by withTheme(Menu)) in withTheme(Menu) in Unknown (created by App) in RCTSafeAreaView in SafeAreaView (created by App) in RCTView (created by View) in View (created by AnimatedComponent) in AnimatedComponent in AnimatedComponentWrapper (created by Surface) in Surface in ThemedComponent (created by withTheme(Surface)) in withTheme(Surface) (created by App) in ThemeProvider (created by App) in ThemeProvider (created by Provider) in RCTView (created by View) in View (created by Portal.Host) in Portal.Host (created by Provider) in Provider (created by App) in App (created by ExpoRoot) in ExpoRoot in RCTView (created by View) in View (created by AppContainer) in DevAppContainer (created by AppContainer) in RCTView (created by View) in View (created by AppContainer) in AppContainer at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError at node_modules/expo-error-recovery/build/ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0 Error: Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`. Please read our getting-started guide and make sure you've followed all the required steps. https://callstack.github.io/react-native-paper/getting-started.html This error is located at: in PortalConsumer in Portal in ThemedComponent (created by withTheme(Portal)) in withTheme(Portal) (created by Menu) in RCTView (created by View) in View (created by Menu) in Menu in ThemedComponent (created by withTheme(Menu)) in withTheme(Menu) in Unknown (created by App) in RCTSafeAreaView in SafeAreaView (created by App) in RCTView (created by View) in View (created by AnimatedComponent) in AnimatedComponent in AnimatedComponentWrapper (created by Surface) in Surface in ThemedComponent (created by withTheme(Surface)) in withTheme(Surface) (created by App) in ThemeProvider (created by App) in ThemeProvider (created by Provider) in RCTView (created by View) in View (created by Portal.Host) in Portal.Host (created by Provider) in Provider (created by App) in App (created by ExpoRoot) in ExpoRoot in RCTView (created by View) in View (created by AppContainer) in DevAppContainer (created by AppContainer) in RCTView (created by View) in View (created by AppContainer) in AppContainer at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError at node_modules/expo-error-recovery/build/ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0 Error: EISDIR: illegal operation on a directory, read at Object.readSync (node:fs:723:3) at tryReadSync (node:fs:433:20) at Object.readFileSync (node:fs:479:19) at UnableToResolveError.buildCodeFrameMessage (/Users/huckjulius/Projects/Test/my-app/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:347:17) at new UnableToResolveError (/Users/huckjulius/Projects/Test/my-app/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:333:35) at ModuleResolver.resolveDependency (/Users/huckjulius/Projects/Test/my-app/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:211:15) at DependencyGraph.resolveDependency (/Users/huckjulius/Projects/Test/my-app/node_modules/metro/src/node-haste/DependencyGraph.js:413:43) at /Users/huckjulius/Projects/Test/my-app/node_modules/metro/src/lib/transformHelpers.js:317:42 at /Users/huckjulius/Projects/Test/my-app/node_modules/metro/src/Server.js:1471:14 at Generator.next () [Unhandled promise rejection: Error: Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`.] at https://callstack.github.io/react-native-paper/getting-started.html:null in at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:136855:25 in checkManager at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:136825:33 in componentDidMount$ at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:27124:22 in tryCatch at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:27294:31 in invoke at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:27124:22 in tryCatch at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:27196:29 in invoke at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:27226:18 in at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:31984:8 in tryCallTwo at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:32148:24 in doResolve at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:32007:13 in Promise at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:27225:32 in callInvokeWithMethodAndArg at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:27230:156 in enqueue at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:27245:68 in at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:136821:41 in componentDidMount at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:21280:46 in commitLifeCycles at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:23316:28 in commitLayoutEffects at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:9898:20 in invokeGuardedCallbackProd at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:10002:41 in invokeGuardedCallback at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:23098:35 in commitRootImpl at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:56909:29 in unstable_runWithPriority at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:22986:23 in commitRoot at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:22530:18 in performSyncWorkOnRoot at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:13775:39 in at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:56909:29 in unstable_runWithPriority at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:13770:29 in flushSyncCallbackQueueImpl at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:13759:34 in flushSyncCallbackQueue at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:22546:34 in batchedUpdates$1 at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:11337:35 in batchedUpdates at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:11429:22 in _receiveRootNodeIDEvent at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:11483:33 in receiveTouches at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:3749:35 in __callFunction at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:3477:30 in at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:3703:14 in __guard at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:3476:20 in callFunctionReturnFlushedQueue

Here is my test project: https://github.com/juliushuck/issue-react-native-paper-dropdown