Tried to register two views with the same name AndroidDropdownPicker
all the package are updated, the picker is work very well
import {Picker} from '@react-native-community/picker';
but when i import button from native base i got this error
Tried to register two views with the same name AndroidDropdownPicker
import {Button} from 'native-base'
when i delete it the error go as well , so i think its kind of conflict between the picker community and native base versions.
Im facing the same problem, native-base is there in my node_modules, however Im not using it in the component where I added
import {Picker} from '@react-native-community/picker';
Not sure why its not working
Facing same problem, Before i was using Picker from 'react-native ' now when its Deprecated so I switched to Picker from ''@react-native-community/picker';' and I am getting Error "Invariant Violation: Tried to register two views with the same name AndroidDropdownPicker", I am also using some classes from "native-base" if that is making this issue so how could i use them ?
+1
I renamed the import and it worked!
import { Picker as Select } from '@react-native-community/picker';
I renamed the import and it worked!
import { Picker as Select } from '@react-native-community/picker';
still doesn't work for me..
+1
+1
In my case,
I tried to use Picker from 'react-native' but it was deprecated.
So I add '@react-native-community/picker' and import Picker from @react-native-community/picker
The bug was occured when I doing import community/picker and finally I solved with removing const MyPicker = styled.Picker``;.
I guess styled.Picker <= means Picker in react-native(deprecated). Thus we can show Tried to register ~ because of duplicated Picker
I opened a pr to fix this issue here: https://github.com/react-native-community/react-native-picker/pull/99
@raymochi Thanks for the fix!
We've released 1.6.5 that includes the fix :tada:
Downloaded the latest version still giving me the error Tried to register two views with the same name AndroidDropdownPicker
downloaded the latest version, still seeing this error.
Still getting the same error Invariant Violation: Tried to register two views with the same name RNCAndroidDropdownPicker
if you're using react-native-picker-select, see https://github.com/lawnstarter/react-native-picker-select/issues/374
In my case, here is the way I found to temporarily solve the problem. It is obviously not the best way, but it was the one I found at the time.
https://github.com/GeekyAnts/NativeBase/issues/3114#issuecomment-706439559
I am having a similar issue with this. I get the following error message - Invariant Violation: Tried to register two views with the same name RNCAndroidDropdownPicker
My import statement looks like the following :
import { Picker } from "@react-native-picker/picker";
I have tried this fix but it didn't work. Let's see where this goes. 👍🏽
Looks like native-base implements @react-native-picker/picker for its Picker component, so if you already have native-base installed, use it instead:
import { Picker } from "native-base";
+1
Looks like native-base implements @react-native-picker/picker for its Picker component, so if you already have native-base installed, use it instead:
import { Picker } from "native-base";
Thx dude, it works for me
Importing Picker from native-base didn't work for me.
As I only have a limited number of Native-Base components in my app, one solution is to ensure the NativeBase Picker code is not used.
- import { Root as NativeBaseRoot } from 'native-base';
+ import { Root as NativeBaseRoot } from 'native-base/src/basic/Root';
Not a great solution and can't work for everyone but was helpful for me