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

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

Open luksinocencio opened this issue 4 years ago • 20 comments

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')

luksinocencio avatar Aug 08 '20 03:08 luksinocencio

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

rahulnainwal107 avatar Aug 10 '20 12:08 rahulnainwal107

Same issue

developerjay8 avatar Aug 14 '20 19:08 developerjay8

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.

amirduran avatar Aug 16 '20 09:08 amirduran

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

malekkbh avatar Aug 23 '20 18:08 malekkbh

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.

mgwedd avatar Sep 21 '20 23:09 mgwedd

fixing in node_modules is not a good solution :(

mohamad11badrah avatar Sep 28 '20 09:09 mohamad11badrah

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

this actually works

yuricorrea avatar Sep 30 '20 17:09 yuricorrea

same issue with react-native 0.63.2

murtazakaz avatar Oct 01 '20 07:10 murtazakaz

#241 (comment)

this actually works

I tried this, no work here

luksinocencio avatar Oct 02 '20 18:10 luksinocencio

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

farhanmeo avatar Oct 13 '20 14:10 farhanmeo

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

nitishkumar325 avatar Nov 12 '20 06:11 nitishkumar325

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 ;)

amirduran avatar Nov 12 '20 07:11 amirduran

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

Victorvikson1996 avatar Nov 15 '20 17:11 Victorvikson1996

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

zapcriativo avatar Dec 03 '20 17:12 zapcriativo

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'

yeukfei02 avatar Dec 12 '20 09:12 yeukfei02

@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?

theforceofhabit avatar Jan 15 '21 14:01 theforceofhabit

@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

yeukfei02 avatar Jan 23 '21 04:01 yeukfei02

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.

SagarKhengat avatar Jan 30 '21 13:01 SagarKhengat

@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

zapcriativo avatar Apr 13 '21 15:04 zapcriativo

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

Aromii avatar Sep 27 '22 05:09 Aromii