react-native-material-dropdown icon indicating copy to clipboard operation
react-native-material-dropdown copied to clipboard

TypeError

Open shahanshah87 opened this issue 4 years ago • 21 comments

What I did just install this library. And I am getting TypeError as:- Screenshot 2020-04-02 at 6 52 32 PM Version:- Screenshot 2020-04-02 at 8 05 40 PM

Please Help!!! Thanks in advance!!!

shahanshah87 avatar Apr 02 '20 14:04 shahanshah87

I'm wondering if it's an issue with the latest version of React Native. It works for me in a project that is on 59.9, but my new project using 62.0 gets a similar TypeError: Cannot read property 'style' of undefined

ckasek avatar Apr 02 '20 15:04 ckasek

React Native 0.62 removed propTypes. You need to remove the line:

itemTextStyle: Text.propTypes.style,

EricWiener avatar Apr 03 '20 18:04 EricWiener

React Native 0.62 removed propTypes. You need to remove the line:

itemTextStyle: Text.propTypes.style,

I did remove this line from node_module/react-native-material-dropdown/src/component/index.js line 136 but this not working too. I even tried after removing itemTextStyle from line 582 and 633, but it does not work again. What should I do now?

shahanshah87 avatar Apr 04 '20 11:04 shahanshah87

Try removing any occurrence of Text.propTypes.style. I was using this library in an old component that wasn't in production anymore, so I just removed the library.

EricWiener avatar Apr 04 '20 14:04 EricWiener

React Native 0.62 removed propTypes. You need to remove the line:

itemTextStyle: Text.propTypes.style,

I did remove this line from node_module/react-native-material-dropdown/src/component/index.js line 136 but this not working too. I even tried after removing itemTextStyle from line 582 and 633, but it does not work again. What should I do now?

just found out that another library that is used in react-native-material-dropdown also use those deprecated props: it's react-native-material-textfield

OrLevy23 avatar Apr 06 '20 10:04 OrLevy23

i also have the same issue and have tried with above solution but still not working.

anshumanburman avatar Apr 06 '20 10:04 anshumanburman

Its working fine in version 0.61.5 but this issue is in 0.62.0

shahanshah87 avatar Apr 06 '20 10:04 shahanshah87

Try removing any occurrence of Text.propTypes.style. I was using this library in an old component that wasn't in production anymore, so I just removed the library.

I did search all the Text.propTypes.style and remove that but still does not work. I think this issue is with version 0.62.0 because it is working fine in version 0.61.5

shahanshah87 avatar Apr 06 '20 10:04 shahanshah87

@Shahanshah87 i have the same issue it is working fine in 0.61.5 version but not in 0.62 and not any updated of this library. i think, i have to leave using this library.

anshumanburman avatar Apr 07 '20 05:04 anshumanburman

@Shahanshah87 i have the same issue it is working fine in 0.61.5 version but not in 0.62 and not any updated of this library. i think, i have to leave using this library. You can use my fork https://github.com/OrLevy23/react-native-material-dropdown

OrLevy23 avatar Apr 07 '20 06:04 OrLevy23

OrLevy23's fork doesn't show layout for me right, so i've prepared my own fork off latest 0.11.1:

npm i https://github.com/noway/react-native-material-dropdown

noway avatar Apr 10 '20 05:04 noway

OrLevy23's fork doesn't show layout for me right, so i've prepared my own fork off latest 0.11.1:

npm i https://github.com/noway/react-native-material-dropdown

This is working fine. Thanks @noway for this.

shahanshah87 avatar Apr 10 '20 07:04 shahanshah87

    npm i https://github.com/noway/react-native-material-dropdown

This is working fine, thank you @noway

subrahmanyam-mahaswami avatar Apr 13 '20 12:04 subrahmanyam-mahaswami

OrLevy23's fork doesn't show layout for me right, so i've prepared my own fork off latest 0.11.1:

npm i https://github.com/noway/react-native-material-dropdown

after entering npm i https://github.com/noway/react-native-material-dropdown in command prompt it is giving errors.

eriffat896 avatar Apr 15 '20 15:04 eriffat896

The below worked for me, got the answer from the link: Afifa Khan, Stack Overflow

  • Commenting itemTextStyle: Text.propTypes.style in ..\node_modules\react-native-material-dropdown\src\components\dropdown file.

And remove Animated in Animated.Text.propTypes.style in

  • affix/index
  • helper/index
  • label/index

of react-native-material-textfield.

  • And added import { Animated, Text} from 'react-native'; in each of above three files.

pschorey avatar Apr 23 '20 14:04 pschorey

The below worked for me, got the answer from the link: Afifa Khan, Stack Overflow

  • Commenting itemTextStyle: Text.propTypes.style in ..\node_modules\react-native-material-dropdown\src\components\dropdown file.

And remove Animated in Animated.Text.propTypes.style in

  • affix/index
  • helper/index
  • label/index

of react-native-material-textfield.

  • And added import { Animated, Text} from 'react-native'; in each of above three files.

This Worked for me, on a project using RN 0.62. Thank you @pschorey

citadelio avatar May 02 '20 11:05 citadelio

OrLevy23's fork doesn't show layout for me right, so i've prepared my own fork off latest 0.11.1:

npm i https://github.com/noway/react-native-material-dropdown

Working thanks

muhammadashfaq avatar May 20 '20 15:05 muhammadashfaq

I've solved it by these steps..

  1. Remove installed package react-native-material-dropdown

    yarn remove react-native-material-dropdown

  2. Install new packages react-native-material-dropdown-v2 and react-native-paper.

    yarn add react-native-material-dropdown-v2 react-native-paper

  3. Swap react-native-material-dropdown used to react-native-material-dropdown-v2 in your code

    e.g. import { Dropdown } from 'react-native-material-dropdown' to import { Dropdown } from 'react-native-material-dropdown-v2'

jasonjin220 avatar Jul 10 '20 03:07 jasonjin220

3. import { Dropdown } from 'react-native-material-dropdown-v2'

its work for me, thanks

Bulu507 avatar Aug 09 '21 03:08 Bulu507

OrLevy23's fork doesn't show layout for me right, so i've prepared my own fork off latest 0.11.1:

npm i https://github.com/noway/react-native-material-dropdown

thanks, it's work for me

yefimchuk avatar Jul 04 '22 21:07 yefimchuk

npm i https://github.com/noway/react-native-material-dropdown and react-native-material-dropdown-v2 don't work now :( RN 0.69.3. This fact force me to use this more fresh library https://github.com/hoaphantn7604/react-native-element-dropdown

AndreyPatseiko avatar Aug 12 '22 06:08 AndreyPatseiko