Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: undefined is not an object (evaluating '_this.dimensionsChangeSubscription.remove') #82

Closed
RuzenDev opened this issue Oct 2, 2022 · 4 comments

Comments

@RuzenDev
Copy link

RuzenDev commented Oct 2, 2022

Hey!

Thank you very much for this amazing library.

I sometimes have this warning
TypeError: undefined is not an object (evaluating '_this.dimensionsChangeSubscription.remove')

It makes the app stuck.
Anyones help is highly appreciated.

<View
        style={{
          flex: 1,
          position: "absolute",
          height: Dimensions.get("screen").height,
          width: Dimensions.get("screen").width,
          backgroundColor: "transparent",
          marginTop: 50,
          alignContent: "center",
          alignSelf: "center",
          justifyContent: "center",
          zIndex: 9999
        }}>
        <Swiper
          containerStyle={{
            backgroundColor: "transparent",
            width: "100%",
            marginTop: 20
          }}
          disableBottomSwipe
          disableTopSwipe
          onSwiped={this.onSwiped}
          onSwipedRight={this.onSwipedRight}
          onSwipedLeft={this.onSwipedLeft}
          onSwipedAll={this.onSwipedAll}
          cards={this.props.timelineBooks}
          stackSize={3}
          renderCard={(card: {
            isbn: React.Key | null | undefined
            book: { imageUrl: any }
          }) => {
            return (
              <View
                key={card.isbn}
                style={{
                  marginTop: 20,
                  height: Dimensions.get("window").width * 0.9,
                  width: Dimensions.get("window").width * 0.6,
                  alignContent: "center",
                  alignSelf: "center",
                  justifyContent: "center"
                }}>
                <DropShadow
                  style={{
                    shadowColor: "#000",
                    shadowOffset: {
                      width: 2,
                      height: 5
                    },
                    shadowOpacity: 0.4,
                    shadowRadius: 5
                  }}>
                  <FastImage
                    style={styles.bookImage}
                    source={
                      card.book.imageUrl
                        ? {
                            uri: card.book.imageUrl,
                            priority: FastImage.priority.normal,
                            cache: FastImage.cacheControl.immutable
                          }
                        : appearanceMode == "dark"
                        ? require("../../../../../assets/noImage_dark.png")
                        : require("../../../../../assets/noImage_light.png")
                    }
                    resizeMode="contain">
                  </FastImage>
                </DropShadow>
              </View>
              ````
@burak4ydin
Copy link

Same issue...

@burak4ydin
Copy link

Fixed by installing "react-native-deck-swiper": "^2.0.5"

just run

yarn add [email protected]

@lucalves
Copy link

lucalves commented Oct 4, 2022

I gotting this error, too.

I installed ^2.0.9 (most recent version), but doesn't work.

@webraptor
Copy link
Owner

Will be fixed in 2.0.10

webraptor added a commit that referenced this issue Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants