Created
May 17, 2022 06:51
-
-
Save jai-adapptor/ea46013a8e81347a18934754c73437cc to your computer and use it in GitHub Desktop.
FULL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { StyleSheet, ViewStyle, StyleProp } from 'react-native'; | |
import React from 'react'; | |
import { useSkeletonAnimation } from 'react-native-animated-skeleton'; | |
import Animated from 'react-native-reanimated'; | |
interface Props { | |
style?: StyleProp<ViewStyle>; | |
} | |
const ExampleComponent: React.FC<Props> = ({ style, children }) => { | |
const animatedStyle = useSkeletonAnimation({ | |
speed: 1000, | |
}); | |
return ( | |
<Animated.View style={[animatedStyle, styles.container, style]}> | |
{children} | |
</Animated.View> | |
); | |
}; | |
const styles = StyleSheet.create({ | |
container: { | |
borderRadius: 4, | |
backgroundColor: '#DDDDDD', | |
}, | |
}); | |
export default ExampleComponent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment