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

Invariat violation:element type is invalid, expected string but got undefined #10

Closed
mir1198yusuf opened this issue Feb 5, 2021 · 3 comments

Comments

@mir1198yusuf
Copy link

Could not import properly

import HeaderImageScrollView, { TriggeringView } from 'react-native-image-header-scroll-view';

return (
    <HeaderImageScrollView
      maxHeight={200}
      minHeight={100}
      renderForeground={() => (
        <View style={{ height: 150, justifyContent: "center", alignItems: "center" }} >
            <Text style={{ backgroundColor: "transparent" }}>Tap Me!</Text>
        </View>
      )}
    >
      <View style={{ height: 1000 }}>
        <TriggeringView onHide={() => console.log("text hidden")}>
          <Text>Scroll Me!</Text>
        </TriggeringView>
      </View>
    </HeaderImageScrollView>
  );
@Chandravardhan8998
Copy link

Same Problem

@mir1198yusuf
Copy link
Author

This is a mistake in npm website documentation.

So see the GitHub page documentation.
https://github.com/bamlab/react-native-image-header-scroll-view

It is ImageHeaderScrollView (as on GitHub page ) and not HeaderImageScrollView (as on npm page)

So this problem is solved , now another problem the latest version of library doesnot trigger scrolling events as in this issue bamlab/react-native-image-header-scroll-view#92

So use older version of library.
see this two comment for solution.
bamlab/react-native-image-header-scroll-view#92 (comment)
bamlab/react-native-image-header-scroll-view#92 (comment)

Now it should work fine.

@mir1198yusuf
Copy link
Author

Closing issue as problem is solved by using older version.

Solution is the two links mentioned at bottom in previous comment.

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

2 participants