From 094ab9ce7207c3998bcdb559f05f05816a335853 Mon Sep 17 00:00:00 2001 From: Le Tom Date: Wed, 2 Sep 2020 08:50:22 +0800 Subject: [PATCH] Update example --- example/App.js | 4 +--- example/src/ShimmerPlaceholder.js | 8 ++++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/example/App.js b/example/App.js index 5bca40a..2792a5b 100644 --- a/example/App.js +++ b/example/App.js @@ -3,9 +3,7 @@ import React, { PureComponent, Component } from 'react'; import { View, Text, StyleSheet, Animated, Image, ScrollView, FlatList } from 'react-native'; import { LinearGradient } from 'expo-linear-gradient'; -import Shimmer, { createShimmerPlaceholder } from './src/ShimmerPlaceholder' - -const ShimmerPlaceholder = createShimmerPlaceholder(LinearGradient) +import ShimmerPlaceholder from './src/ShimmerPlaceholder' const FacebookContent = ({ isReversed, shimmerColors, hasData, hasBorder, randomWidth }) => { // Handle visible diff --git a/example/src/ShimmerPlaceholder.js b/example/src/ShimmerPlaceholder.js index b37018e..eaf8561 100644 --- a/example/src/ShimmerPlaceholder.js +++ b/example/src/ShimmerPlaceholder.js @@ -46,7 +46,9 @@ const BasedShimmerPlaceholder = (props) => { style, shimmerStyle, isInteraction = true, - LinearGradient, + LinearGradient = global.Expo + ? global.Expo.LinearGradient + : View, children, animatedValue, beginShimmerPosition, @@ -118,6 +120,8 @@ const styles = StyleSheet.create({ }); -export const createShimmerPlaceholder = (LinearGradient) => React.forwardRef((props, ref) => ) +export const createShimmerPlaceholder = (LinearGradient = global.Expo + ? global.Expo.LinearGradient + : View) => React.forwardRef((props, ref) => ) export default ShimmerPlaceholder \ No newline at end of file