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

Support only new architecture with "rnx-gradient" instead of "react-native-linear-gradient" #117

Open
adityabishtedu opened this issue May 19, 2023 · 0 comments

Comments

@adityabishtedu
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

I upgraded to React native version 0.71.7 and skeleton loader is not supported because of "react-native-linear-gradient" as its dependency. But make sure this only works for NEW ARCH ONLY

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-skeleton-placeholder/lib/skeleton-placeholder.js b/node_modules/react-native-skeleton-placeholder/lib/skeleton-placeholder.js
index 353abb6..0f26540 100644
--- a/node_modules/react-native-skeleton-placeholder/lib/skeleton-placeholder.js
+++ b/node_modules/react-native-skeleton-placeholder/lib/skeleton-placeholder.js
@@ -36,7 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
 const masked_view_1 = __importDefault(require("@react-native-masked-view/masked-view"));
 const React = __importStar(require("react"));
 const react_native_1 = require("react-native");
-const react_native_linear_gradient_1 = __importDefault(require("react-native-linear-gradient"));
+const react_native_linear_gradient_1 = __importDefault(require("rnx-gradient"));
 const WINDOW_WIDTH = react_native_1.Dimensions.get('window').width;
 const logEnabled = false;
 const SkeletonPlaceholder = ({ children, enabled = true, backgroundColor = '#E1E9EE', highlightColor = '#F2F8FC', speed = 800, direction = 'right', borderRadius, shimmerWidth, }) => {

This issue body was partially generated by patch-package.

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

1 participant