react-native-material-dropdown
react-native-material-dropdown copied to clipboard
TypeError
What I did just install this library.
And I am getting TypeError as:-
Version:-
Please Help!!! Thanks in advance!!!
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
React Native 0.62 removed propTypes. You need to remove the line:
itemTextStyle: Text.propTypes.style,
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?
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.
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
i also have the same issue and have tried with above solution but still not working.
Its working fine in version 0.61.5 but this issue is in 0.62.0
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 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.
@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'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
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.
npm i https://github.com/noway/react-native-material-dropdown
This is working fine, thank you @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
after entering npm i https://github.com/noway/react-native-material-dropdown
in command prompt it is giving errors.
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.
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
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
I've solved it by these steps..
-
Remove installed package
react-native-material-dropdown
yarn remove react-native-material-dropdown
-
Install new packages
react-native-material-dropdown-v2
andreact-native-paper
.yarn add react-native-material-dropdown-v2 react-native-paper
-
Swap
react-native-material-dropdown
used toreact-native-material-dropdown-v2
in your codee.g.
import { Dropdown } from 'react-native-material-dropdown'
toimport { Dropdown } from 'react-native-material-dropdown-v2'
3. import { Dropdown } from 'react-native-material-dropdown-v2'
its work for me, thanks
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
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