Skip to content

Commit 6a2c8e8

Browse files
committed
Setting useNativeDriver explicitly.
1 parent 4b1f243 commit 6a2c8e8

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

lib/BaseInput.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export default class BaseInput extends Component {
107107
toValue: isActive ? 1 : 0,
108108
duration: animationDuration,
109109
easing,
110-
useNativeDriver,
110+
useNativeDriver: useNativeDriver || false,
111111
}).start();
112112
}
113113

lib/Jiro.js

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React from 'react';
2-
import PropTypes from 'prop-types';
1+
import React from "react";
2+
import PropTypes from "prop-types";
33
import {
44
Animated,
55
Easing,
@@ -8,9 +8,9 @@ import {
88
TouchableWithoutFeedback,
99
View,
1010
StyleSheet,
11-
} from 'react-native';
11+
} from "react-native";
1212

13-
import BaseInput from './BaseInput';
13+
import BaseInput from "./BaseInput";
1414

1515
export default class Jiro extends BaseInput {
1616
static propTypes = {
@@ -20,7 +20,7 @@ export default class Jiro extends BaseInput {
2020
};
2121

2222
static defaultProps = {
23-
borderColor: 'red',
23+
borderColor: "red",
2424
inputPadding: 16,
2525
height: 48,
2626
};
@@ -45,19 +45,22 @@ export default class Jiro extends BaseInput {
4545
toValue: animationValue,
4646
eaasing: Easing.bezier(0.2, 1, 0.3, 1),
4747
duration: 200,
48+
useNativeDriver: false,
4849
}
4950
);
5051
const borderHeightAnimation = Animated.timing(this.state.borderHeightAnim, {
5152
toValue: animationValue,
5253
eaasing: Easing.ease,
5354
duration: 200,
55+
useNativeDriver: false,
5456
});
5557
const labelPositionAnimation = Animated.timing(
5658
this.state.labelPositionAnim,
5759
{
5860
toValue: animationValue,
5961
eaasing: Easing.ease,
6062
duration: 200,
63+
useNativeDriver: false,
6164
}
6265
);
6366

@@ -135,7 +138,7 @@ export default class Jiro extends BaseInput {
135138
onBlur={this._onBlur}
136139
onChange={this._onChange}
137140
onFocus={this._onFocus}
138-
underlineColorAndroid={'transparent'}
141+
underlineColorAndroid={"transparent"}
139142
/>
140143
<TouchableWithoutFeedback onPress={this.focus}>
141144
<Animated.View
@@ -144,15 +147,16 @@ export default class Jiro extends BaseInput {
144147
{
145148
bottom: labelPositionAnim.interpolate({
146149
inputRange: [0, 1],
147-
outputRange: [inputPadding / 2, inputHeight + inputPadding / 4],
150+
outputRange: [
151+
inputPadding / 2,
152+
inputHeight + inputPadding / 4,
153+
],
148154
}),
149155
left: inputPadding,
150156
},
151157
]}
152158
>
153-
<Text style={[styles.label, labelStyle]}>
154-
{label}
155-
</Text>
159+
<Text style={[styles.label, labelStyle]}>{label}</Text>
156160
</Animated.View>
157161
</TouchableWithoutFeedback>
158162
</View>
@@ -162,24 +166,24 @@ export default class Jiro extends BaseInput {
162166

163167
const styles = StyleSheet.create({
164168
labelContainer: {
165-
position: 'absolute',
166-
backgroundColor: 'transparent',
169+
position: "absolute",
170+
backgroundColor: "transparent",
167171
},
168172
label: {
169173
fontSize: 13,
170-
fontWeight: 'bold',
171-
color: '#6a7989',
174+
fontWeight: "bold",
175+
color: "#6a7989",
172176
},
173177
textInput: {
174-
position: 'absolute',
178+
position: "absolute",
175179
bottom: 0,
176180
padding: 0,
177-
color: 'black',
181+
color: "black",
178182
fontSize: 18,
179-
fontWeight: 'bold',
183+
fontWeight: "bold",
180184
},
181185
border: {
182-
position: 'absolute',
186+
position: "absolute",
183187
bottom: 0,
184188
left: 0,
185189
right: 0,

0 commit comments

Comments
 (0)