TypeError: undefined is not an object (evaluating '_reactNative.Animated.Text.propTypes.style')
I solved this by,
Commenting
itemTextStyle: Text.propTypes.style
in
..\node_modules\react-native-material-dropdown\src\components\dropdown
file.And remove
Animated
inAnimated.Text.propTypes.style
inaffix/index
helper/index
label/index
of
react-native-material-textfield
.And added
import { Animated, Text} from 'react-native';
in each of above three files.
Here is another solution I've found.
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
toreact-native-material-dropdown-v2
in your codee.g.
import { Dropdown } from 'react-native-material-dropdown'
toimport { Dropdown } from 'react-native-material-dropdown-v2'
I found the same problem while using @react-navigation/drawer
I've solved it by these steps.
- Open
node_modules
and then search forreact-native-material-textfield
open the file and go tosrc
folder - Under
src
you will seeaffix
,helper
,label
folder - under each folder, there is anindex.js
- open the
index.js
of the mentioned folders one by one (all 3 folders) and search for the textstyle: Animated.Text.propTypes.style
, and replace it bystyle: Text.propTypes
- And import text form react-native like this
import { Animated , Text} from 'react-native';
- And now reload the terminal, and you are good to go