Skip to content

Commit cd5a2ea

Browse files
committed
ref: Prop passing fix
1 parent b48ce46 commit cd5a2ea

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

example/lib/InteractiveTextInput.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as React from "react";
22
import {
3-
View,
43
Dimensions,
54
StyleProp,
65
TextInput,
@@ -13,7 +12,7 @@ import {
1312
*/
1413
import styles from "./InteractiveTextInput.style";
1514

16-
const { width: ScreenWidth, height: ScreenHeight } = Dimensions.get("screen");
15+
const { width: ScreenWidth } = Dimensions.get("screen");
1716
const AnimatedTextInput = Animated.createAnimatedComponent(TextInput);
1817

1918
const SUCCESS_COLOR = "#008FEB";
@@ -26,17 +25,16 @@ type CustomStyleProp = StyleProp<ViewStyle> | Array<StyleProp<ViewStyle>>;
2625
interface IInteractiveTextInputProps extends TextInputProps {
2726
style?: CustomStyleProp;
2827
}
29-
interface IProps {}
3028

3129
interface IState {}
3230

3331
export default class InteractiveTextInput extends React.Component<
34-
IProps,
32+
IInteractiveTextInputProps,
3533
IState
3634
> {
3735
interpolatedColor: Animated.Value;
3836

39-
constructor(props: IProps) {
37+
constructor(props: IInteractiveTextInputProps) {
4038
super(props);
4139
this.interpolatedColor = new Animated.Value(ORIGINAL_VALUE);
4240
this.state = {};
@@ -50,7 +48,7 @@ export default class InteractiveTextInput extends React.Component<
5048
}).start();
5149
};
5250

53-
showSuccessColor = () => {
51+
showFocusColor = () => {
5452
Animated.timing(this.interpolatedColor, {
5553
duration: 450,
5654
toValue: SUCCESS_VALUE,
@@ -78,7 +76,7 @@ export default class InteractiveTextInput extends React.Component<
7876
}}
7977
placeholder="Email"
8078
onFocus={() => {
81-
this.showSuccessColor();
79+
this.showFocusColor();
8280
}}
8381
onBlur={() => {
8482
this.showOriginColor();

0 commit comments

Comments
 (0)