n4kz / react-native-material-dropdown

Material dropdown with consistent behaviour on iOS and Android
Other
732 stars 597 forks source link

TypeError: undefined is not an object (evaluating '_reactNative.Animated.Text.propTypes.style') #249

Open luksinocencio opened 4 years ago

luksinocencio commented 4 years ago

Simulator Screen Shot - iPhone 11 - 2020-08-08 at 00 42 31 On recent version react-native (0.63.0) appears this error, I tryied to fix, but I didnt

TypeError: undefined is not an object (evaluating '_reactNative.Animated.Text.propTypes.style')

rahulnainwal107 commented 4 years ago

i am also getting the same issue with react-native 0.63.2.

developerjay8 commented 4 years ago

Same issue

amirduran commented 4 years ago

Obviously is the library deprecated. I see some PR that are maybe fixing the issue. Try to fork the project and merge those pull requests to your fork.

malekkbh commented 4 years ago

you may wanna take a look at this :) https://medium.com/swlh/how-to-add-a-dropdown-list-to-react-native-2441d6fe40c2

mgwedd commented 3 years ago

Also seeing the same issue after upgrading to RN 0.63.2. This lib should be marked as incompatible with at least 0.63.2 and maybe older versions too.

mohamad11badrah commented 3 years ago

fixing in node_modules is not a good solution :(

yuricorrea commented 3 years ago

https://github.com/n4kz/react-native-material-dropdown/issues/241#issuecomment-658078613

this actually works

murtazakaz commented 3 years ago

same issue with react-native 0.63.2

luksinocencio commented 3 years ago

#241 (comment)

this actually works

I tried this, no work here

farhanmeo commented 3 years ago

Hopefully This will help you out https://stackoverflow.com/a/62794092/10806465

nitishkumar325 commented 3 years ago

use this to resolve problem

Open node_modules and then search for react-native-material-textfield open the file and go to src folder Under src you will see affix, helper, label folder - under each folder, there is an index.js open the index.js of the mentioned folders one by one (all 3 folders) and search for the text style: Animated.Text.propTypes.style, and replace it by style: 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

amirduran commented 3 years ago

use this to resolve problem

Open node_modules and then search for react-native-material-textfield open the file and go to src folder Under src you will see affix, helper, label folder - under each folder, there is an index.js open the index.js of the mentioned folders one by one (all 3 folders) and search for the text style: Animated.Text.propTypes.style, and replace it by style: 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

This is wrong and DO NOT do it like that because next time you install npm packages your changes will be overwritten ;)

Victorvikson1996 commented 3 years ago

use this to resolve problem Open node_modules and then search for react-native-material-textfield open the file and go to src folder Under src you will see affix, helper, label folder - under each folder, there is an index.js open the index.js of the mentioned folders one by one (all 3 folders) and search for the text style: Animated.Text.propTypes.style, and replace it by style: 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

This is wrong and DO NOT do it like that because next time you install npm packages your changes will be overwritten ;)

pls tell me how to solve this problem

zapcriativo commented 3 years ago

For those who don't want to edit node_modules each time, here is a patch file according to @Fabrice-Beya advice using patch-package.

Instruction:

Create patches directory in your project's root Copy patch to patches/react-native-material-textfield+0.12.0patch yarn add patch-package postinstall-postinstall or npm i patch-package yarn patch-package or npx patch-package

Fix is already applied. Add the following to package.json to not repeat the same next time:

"scripts": {
  "postinstall": "patch-package"
 }

Fix using example from https://github.com/n4kz/react-native-material-textfield/issues/249#issuecomment-625791243 editing version of patch only

yeukfei02 commented 3 years ago

I encounter the same issue with using expo 40.0.0 and react-native 40.0.0 in my project

i find the solution in stackoverflow, second answer

https://stackoverflow.com/questions/61226530/typeerror-undefined-is-not-an-object-evaluating-reactnative-animated-text-pr

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 and react-native-paper

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

Swap react-native-material-dropdown 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'
theforceofhabit commented 3 years ago

@yeukfei02, @zapcriativo Thanks for this info, It really helped a lot. But now my dropdown's appearance is completely changed Original: 0F1A1E74-9064-4F58-8B97-A62DFEDDF8B7_4_5005_c

After using V2 EE7F194E-38C6-4387-858E-1CBB875E1D6D_4_5005_c

Do you have any recommendations on how to go about solving this? Or should I wait for the fix in the original react-native-material-dropdown?

yeukfei02 commented 3 years ago

@theforceofhabit

I guess the worst case is to avoid to use react-native-material-dropdown because expo will keep update, but this lib wont update.

so better switch to use another dropdown lib in react native with expo

SagarKhengat commented 3 years ago

I fixed it by adding react-native-material-dropdown, react-native-material-textfield, react-native-material-buttons libraries locally and then changing Animated.Text.propTypes.style to Text.propTypes.style inside react-native-material-textfield. Not an elegant solution but worked for me.

zapcriativo commented 3 years ago

@yeukfei02, @zapcriativo Thanks for this info, It really helped a lot. But now my dropdown's appearance is completely changed Original: 0F1A1E74-9064-4F58-8B97-A62DFEDDF8B7_4_5005_c

After using V2 EE7F194E-38C6-4387-858E-1CBB875E1D6D_4_5005_c

Do you have any recommendations on how to go about solving this? Or should I wait for the fix in the original react-native-material-dropdown?

It's because you replace react-native-material-dropdown to react-native-material-dropdown-v2 , I had this problem too so I just created the patch

Aromii commented 1 year ago

Animated.Text.propTypes.style

i dnt find folder in node_modules? can you explain me?? (Use node --trace-warnings ... to show where the warning was created) System: OS: macOS 11.6.8 CPU: (4) x64 Intel(R) Core(TM) i5-4308U CPU @ 2.80GHz Memory: 78.20 MB / 8.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 18.9.1 - /usr/local/bin/node Yarn: Not Found npm: 8.19.1 - /usr/local/bin/npm Watchman: 2022.09.19.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 Android SDK: API Levels: 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33 Build Tools: 27.0.1, 27.0.2, 27.0.3, 28.0.0, 28.0.1, 28.0.2, 28.0.3, 29.0.0, 29.0.1, 29.0.2, 29.0.3, 30.0.0, 30.0.1, 30.0.2, 30.0.3, 31.0.0, 32.0.0, 32.1.0, 33.0.0, 33.0.0, 33.0.0 System Images: android-30 | Google Play Intel x86 Atom Android NDK: 22.1.7171670 IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8815526 Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild Languages: Java: 11.0.13 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.70.1 => 0.70.1 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found