adorableio / react-native-animated-ellipsis

A simple, customizable animated dots component for use in React Native apps. Ideal for loading screens.
MIT License
80 stars 45 forks source link

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

Open YogeshBhatt opened 1 year ago

YogeshBhatt commented 1 year ago

Hi! ๐Ÿ‘‹

Firstly, thanks for your work on this project! ๐Ÿ™‚

Today I used patch-package to patch react-native-animated-ellipsis@2.0.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-animated-ellipsis/dist/AnimatedEllipsis.js b/node_modules/react-native-animated-ellipsis/dist/AnimatedEllipsis.js
index 908626b..da8da39 100644
--- a/node_modules/react-native-animated-ellipsis/dist/AnimatedEllipsis.js
+++ b/node_modules/react-native-animated-ellipsis/dist/AnimatedEllipsis.js
@@ -1,5 +1,5 @@
 import React, { Component } from 'react';
-import { Text, Animated, View, StyleSheet } from 'react-native';
+import { Text, Animated, View, StyleSheet, ViewPropTypes } from 'react-native';
 import PropTypes from 'prop-types';

 export default class AnimatedEllipsis extends Component {
@@ -71,7 +71,7 @@ AnimatedEllipsis.propTypes = {
   numberOfDots: PropTypes.number,
   animationDelay: PropTypes.number,
   minOpacity: PropTypes.number,
-  style: Text.propTypes.style
+  style: ViewPropTypes.style
 };
 AnimatedEllipsis.defaultProps = {
   numberOfDots: 3,

This issue body was partially generated by patch-package.

Thanhal-P-A commented 1 year ago

https://www.npmjs.com/package/rn-animated-ellipsis