Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
luksinocencio opened this issue Aug 8, 2020 · 20 comments

Comments

@luksinocencio
Copy link

luksinocencio commented Aug 8, 2020

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
Copy link

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

@developerjay8
Copy link

Same issue

@amirduran
Copy link

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
Copy link

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

@mgwedd
Copy link

mgwedd commented Sep 21, 2020

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
Copy link

mohamad11badrah commented Sep 28, 2020

fixing in node_modules is not a good solution :(

@yuricorrea
Copy link

#241 (comment)

this actually works

@murtazakaz
Copy link

same issue with react-native 0.63.2

@luksinocencio
Copy link
Author

#241 (comment)

this actually works

I tried this, no work here

@farhanmeo
Copy link

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

@nitishkumar325
Copy link

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
Copy link

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
Copy link

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
Copy link

zapcriativo commented Dec 3, 2020

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 n4kz/react-native-material-textfield#249 (comment) editing version of patch only

@yeukfei02
Copy link

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
Copy link

@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
Copy link

@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
Copy link

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
Copy link

@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
Copy link

Aromii commented Sep 27, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests