question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'val' of undefined

See original GitHub issue

This 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:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
blohamencommented, Jun 11, 2019

Initial snap - determines initial snap point of bottom sheet. The value is the INDEX from snapPoints. Try this: initialSnap={1}

0reactions
JakeHadleycommented, Jun 12, 2019

I tried making a new project with it and saw that my gesture-handler package was out of date. Updated and good to go!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found