Open
Description
Getting The Error:
Uncaught TypeError: Cannot read properties of null (reading 'getBoundingClientRect')
at use-scroll-handlers.js:105:32
Code:
import {
View,
Text,
TouchableOpacity,
StyleSheet,
ScrollView,
Linking,
} from "react-native";
import ActionSheet, { ActionSheetRef, ScrollView as ActionSheetScrollView } from "react-native-actions-sheet";
const handleLegal = (type: "terms" | "privacy") => {
actionSheetRef.current?.show();
};
const actionSheetRef = useRef<ActionSheetRef>(null);
<View style={{ flex: 1 }}>
<ScrollView style={styles.container}>
<Text style={styles.sectionTitle}>Profile</Text>
{user ? (
<View style={styles.card}>
<Text style={styles.info}>Name: {user.name}</Text>
<Text style={styles.info}>Email: {user.email}</Text>
</View>
) : (
<Text style={styles.info}>No user logged in</Text>
)}
<Text style={styles.sectionTitle}>Legal</Text>
<TouchableOpacity style={styles.option} onPress={() => handleLegal("terms")}>
<Text style={styles.optionText}>Terms & Conditions</Text>
</TouchableOpacity>
</ScrollView>
<ActionSheet
ref={actionSheetRef}
gestureEnabled
containerStyle={{ height: "80%" }}
>
<ActionSheetScrollView>
<Text style={styles.sheetText}>T&C content goes here...</Text>
<Text style={styles.sheetText}>Privacy Policy content goes here...</Text>
</ActionSheetScrollView>
</ActionSheet>
</View>
Metadata
Metadata
Assignees
Labels
No labels