TypeError: Cannot read property 'val' of undefined
See original GitHub issueThis error is located at BottomSheetBehavior at Map.js:16
Steps to reproduce:
I have a simple app that has a bottom tab bar navigation. From just trying to get this going, it doesn’t show up at all if I remove everything except the snap points, which are listed as required to render. If I include the initialSnap prop in any way, it throws the error in the title. A Map.js
file is one of the screens:
import React from 'react';
import { View, StyleSheet } from 'react-native';
import MapView, { PROVIDER_GOOGLE } from 'react-native-maps';
import BottomSheet from 'reanimated-bottom-sheet';
import renderMarker from './Marker';
const Map = () => {
return (
<View style={{ ...StyleSheet.absoluteFillObject }}>
<BottomSheet
snapPoints={[500, 250]}
renderContent={() => <View />}
initialSnap={250} //this line gives the error described
/>
<MapView
provider={PROVIDER_GOOGLE}
showsUserLocation
showsMyLocationButton
followUserLocation
showsCompass
style={{ ...StyleSheet.absoluteFillObject }}
initialRegion={initialRegion}
>
{renderMarker()}
</MapView>
</View >
);
};
export default Map;
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Uncaught TypeError: Cannot read property 'value' of undefined
I have some JavaScript code that gives this error. Uncaught TypeError: Cannot read property 'value' of undefined.
Read more >[Solved] Cannot read Properties of Undefined in JavaScript
The "Cannot read properties of undefined" error occurs when you try to access a property or a method on a variable that stores...
Read more >Cannot Read Property of Undefined in JavaScript - Rollbar
What Causes TypeError: Cannot Read Property of Undefined ... Undefined means that a variable has been declared but has not been assigned a...
Read more >Uncaught TypeError: Cannot read property of undefined In
JavaScript TypeError is thrown when an operand or argument passed to a function is incompatible with the type expected by that operator or...
Read more >Uncaught TypeError : Cannot read properties of undefined
The root cause of the error is that the declared variable doesn't have any value, so by default, JavaScript treats all variables as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Initial snap - determines initial snap point of bottom sheet. The value is the INDEX from snapPoints. Try this: initialSnap={1}
I tried making a new project with it and saw that my gesture-handler package was out of date. Updated and good to go!