question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tried to register two views with the same name AndroidDropdownPicker

See original GitHub issue

Describe the bug
Getting error with following message:

Tried to register two views with the same name AndroidDropdownPicker

The error seems to be similar to this: https://github.com/react-native-community/react-native-picker/issues/15

To Reproduce
Steps to reproduce the behavior: In my project, I have used also this component: import { Picker } from ‘@react-native-community/picker’; I believe it is a clash between these components. Any way to avoid this error and be able to use both?

Expected behavior
Be able to use this component without clashing with other components.

Screenshots
“n/a”.

Additional details

  • Device: Android
  • OS: Android 10
  • react-native-picker-select version: 7.0.0
  • react-native version: 0.62.2
  • react version: 16.11.0

Reproduction and/or code sample

import React, { useState } from 'react';
import { StyleSheet, TouchableNativeFeedback, View, Text, Image } from 'react-native';
import RNPickerSelect from 'react-native-picker-select';

export default function AdminHome({ navigation }) {
    return (
            <View>
                <RNPickerSelect
                accessibilityLabel={'gender'}
                    onValueChange={(value) => console.log(value)}
                    items={[
                        { label: 'Football', value: 'football' },
                        { label: 'Baseball', value: 'baseball' },
                        { label: 'Hockey', value: 'hockey' },
                    ]}
                />
        </View>
    );
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
whatdtechcommented, Dec 15, 2020

@react-native-community/picker deprecated. So remove it by yarn remove @react-native-community/picker and install yarn add @react-native-picker/picker . This solved the issue for me.

3reactions
higor21commented, Dec 7, 2020

I fixed this problema installing the following versions: "@react-native-community/picker": "1.6.0" "react-native-picker-select": "7",

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tried to register two views with the same name RNCPicker ...
Describe the bug I am trying to implement this react-native-picker-select in the react-native app but after npm install, tried to run the ...
Read more >
Invariant Violation: Tried to register two views with the same ...
To get rid of that, do the following: Since the error is about registering two views with the same name, declare your Picker...
Read more >
Invariant Violation: Tried To Register Two Views With The ...
CSDNInvariant Violation : Tried to register two views with the same name AndroidDropdownPicker. CSDNTried to register two views with the same name ...
Read more >
Tried to register two views with the same name RNSVGSvgView
Hello, why I get this error message? Tried to register two views with the same name RNSVGSvgVie I want to use svg, and...
Read more >
ERROR Invariant Violation: Tried to register two views with the ...
Solucionado | Boa tarde, nesta aula estou com o seguinte erro log: ERROR Invariant Violation: Tried to register two views with the same...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found