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

Cannot read property 'contentOffset' of undefined #462

Open
hellofarhan opened this issue Nov 3, 2021 · 1 comment
Open

Cannot read property 'contentOffset' of undefined #462

hellofarhan opened this issue Nov 3, 2021 · 1 comment

Comments

@hellofarhan
Copy link

hellofarhan commented Nov 3, 2021

If I try to run your example code got the following errors.

1. Cannot read property 'contentOffset' of undefined
2. TypeError: Cannot read property 'sumHeight' of undefined

return (
    <SpringScrollView>
      <WaterfallList
        data={data}
        ref={waterfaller}
        initialContentOffset={{ x: 0, y: 0 }}
        heightForItem={item => 180}
        preferColumnWidth={120}
        renderItem={renderCell}
        renderHeader={renderHeader}
        renderFooter={renderFooter}
        onRefresh={() => {
          setTimeout(() => waterfaller.current.endRefresh(), 2000);
        }}
        onLoading={() => {
          setTimeout(() => waterfaller.current.endLoading(), 2000);
        }}
      />
    </SpringScrollView>
  );

InkedScreenshot_1635961544

@hellofarhan
Copy link
Author

When I was using yarn add react-native-spring-scrollview it installed the version "react-native-spring-scrollview": "^4.0.0-dev-0" by default. This is conflicting with "react-native-largelist": "^3.1.0-rc.2".

So if I use "react-native-spring-scrollview": "^3.0.1-rc.5" error Cannot read property 'contentOffset' of undefined has gone. I think there is a compatibility issue with these plugins. Better update the examples with latest react-native-spring-scrollview.

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

1 participant