They downloaded the module and did not have an example, so they said they could not find the function.
Error message is:
undefined is not a function (evaluating 'this.scroll.props._scrollToFocusedInput(reactNode)')
use page code:
~~~js
import React from "react";
import {
View,
Text,
TouchableOpacity,
Dimensions,
TextInput,
ActivityIndicator,
AsyncStorage,
Alert,
Image,
Platform,
KeyboardAvoidingView,
findNodeHandle
} from "react-native";
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scrollview";
import "../../global";
import { Ionicons } from "@expo/vector-icons";
import styles from "./styles.js";
const { windowHidth, windowHeight } = Dimensions.get("window");
class TakeWalletScreen extends React.Component {
constructor(props) {
super(props);
this.state = {
walletname: "",
password: ""
};
}
static navigationOptions = ({ navigation }) => {
return {
headerLeft: (
onPress={() => navigation.goBack()}
>
),
headerRight: null
};
};
_scrollToInput(reactNode: any) {
// Add a 'scroll' ref to your ScrollView
this.scroll.props._scrollToFocusedInput(reactNode);
}
render() {
if (this.state.keystoredata === undefined) {
size="large"
/>;
}
return (
ref={ref => (this.scroll = ref)}
>
resizeMode="stretch"
style={{ alignSelf: "center" }}
/>
>
resizeMode: "stretch"
}}
source={require("../../image/oval_gray.png")}
/>
resizeMode: "stretch"
}}
source={require("../../image/oval_yellow.png")}
/>
resizeMode: "stretch"
}}
source={require("../../image/oval_gray.png")}
/>
resizeMode: "stretch"
}}
source={require("../../image/oval_gray.png")}
/>
fontWeight: "bold",
paddingBottom: 10,
fontSize: 18
}}
>
์ง๊ฐ ๊ฐ์ ธ์ค๊ธฐ
<Text
style={{
fontSize: 16
}}
>
{`์ง๊ฐ๋ช
๊ณผ ๊ฐ์ ธ์จ ์ง๊ฐ์ ๋น๋ฐ๋ฒํธ๋ฅผ${"\n"}์
๋ ฅํด์ฃผ์ธ์.`}
</Text>
<View
style={{
flexDirection: "row",
paddingTop: 45,
paddingLeft: 3,
paddingBottom: 8
}}
>
<Text
style={{
fontSize: 14,
fontWeight: "bold"
}}
>
์ง๊ฐ์ด๋ฆ
</Text>
</View>
<View
style={{
flexDirection: "row",
backgroundColor: "#f6f6ef",
width: "90%",
height: 50,
justifyContent: "flex-start"
}}
>
<TextInput
style={{
width: "80%",
height: 50,
paddingLeft: 10
}}
returnKeyType="next"
placeholder={"์ง๊ฐ ์ด๋ฆ์ ์
๋ ฅํด์ฃผ์ธ์."}
onChangeText={walletname => this.setState({ walletname })}
value={this.state.walletname}
textContentType="nickname"
underlineColorAndroid={"#f6f6ef"}
onSubmitEditing={() => this.password.focus()}
/>
{/* {this.state.nickname.length >= 2 ? (
<View
style={{
height: "100%",
width: "20%",
alignItems: "center",
justifyContent: "center"
}}
>
<Ionicons name="ios-checkmark" size={50} color="yellow" />
</View>
) : (
<View
style={{
height: "100%",
width: "20%",
alignItems: "center",
justifyContent: "center"
}}
>
<Ionicons name="ios-checkmark" size={50} color="gray" />
</View>
)} */}
</View>
<Text style={{ paddingLeft: 5, color: "#d22e2e", fontSize: 12 }}>
{this.state.checknick}
</Text>
<View
style={{
flexDirection: "row",
paddingTop: 30,
paddingLeft: 3,
paddingBottom: 8
}}
>
<Text
style={{
fontSize: 14,
fontWeight: "bold"
}}
>
๋น๋ฐ๋ฒํธ
</Text>
<Text
style={{
fontSize: 12,
color: "#434343",
paddingLeft: 5
}}
>
์๋ฌธ/์ซ์ ์กฐํฉ,8์๋ฆฌ ์ด์
</Text>
</View>
<View
style={{
flexDirection: "row",
backgroundColor: "#f6f6ef",
width: "90%",
height: 50,
justifyContent: "flex-start"
}}
>
<TextInput
style={{
width: "80%",
height: 50,
paddingLeft: 10
}}
returnKeyType="go"
placeholder={"๋น๋ฐ๋ฒํธ๋ฅผ ์
๋ ฅํด์ฃผ์ธ์."}
onChangeText={password => this.setState({ password })}
value={this.state.password}
textContentType="password"
underlineColorAndroid={"#f6f6ef"}
ref="password"
onFocus={(event: Event) => {
this._scrollToInput(findNodeHandle(event.target));
}}
/>
{/* {this.state.nickname.length >= 2 ? (
<View
style={{
height: "100%",
width: "20%",
alignItems: "center",
justifyContent: "center"
}}
>
<Ionicons name="ios-checkmark" size={50} color="yellow" />
</View>
) : (
<View
style={{
height: "100%",
width: "20%",
alignItems: "center",
justifyContent: "center"
}}
>
<Ionicons name="ios-checkmark" size={50} color="gray" />
</View>
)} */}
</View>
</View>
</View>
<View style={styles.walletscreenlayout4}>
<TouchableOpacity
style={styles.walletscreen3button}
onPress={async () => {
if (
this.state.nickname.length >= 2 &&
this.state.walletname.length >= 2 &&
this.state.nickname.length <= 8
) {
this.setState({
disabled: true
});
this.checkNickName();
} else {
Alert.alert("์๋ด", "๋๋ค์์ 2์~8์๋ก ํด์ฃผ์ธ์.");
}
}}
disabled={this.state.disabled}
>
<Text style={{ color: "#fff" }}>์ค์ ํ๊ธฐ</Text>
</TouchableOpacity>
</View>
</View>
</KeyboardAwareScrollView>
);
}
}
export default TakeWalletScreen;
~~~
please help me
Use innerRef to get the component reference and use this.scrollRef.props to access these methods.
Having the same issue.
Too bad Haper's comment is useless.