feat: use Animated.X for header title and background

This commit is contained in:
Dulmandakh
2019-09-22 01:01:33 +02:00
parent 25d3e96d0e
commit ed4bc26aa1
2 changed files with 6 additions and 4 deletions

View File

@@ -1,8 +1,9 @@
import * as React from 'react';
import { View, StyleSheet, Platform, ViewProps } from 'react-native';
import { StyleSheet, Platform, ViewProps } from 'react-native';
import Animated from 'react-native-reanimated';
export default function HeaderBackground({ style, ...rest }: ViewProps) {
return <View style={[styles.container, style]} {...rest} />;
return <Animated.View style={[styles.container, style]} {...rest} />;
}
const styles = StyleSheet.create({

View File

@@ -1,12 +1,13 @@
import * as React from 'react';
import { Text, StyleSheet, Platform, TextProps } from 'react-native';
import { StyleSheet, Platform, TextProps } from 'react-native';
import Animated from 'react-native-reanimated';
type Props = TextProps & {
children?: string;
};
export default function HeaderTitle({ style, ...rest }: Props) {
return <Text {...rest} style={[styles.title, style]} />;
return <Animated.Text {...rest} style={[styles.title, style]} />;
}
const styles = StyleSheet.create({