Skip to content

Instantly share code, notes, and snippets.

@jai-adapptor
Created May 17, 2022 06:51
Show Gist options
  • Save jai-adapptor/ea46013a8e81347a18934754c73437cc to your computer and use it in GitHub Desktop.
Save jai-adapptor/ea46013a8e81347a18934754c73437cc to your computer and use it in GitHub Desktop.
FULL
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