Skip to content
This repository was archived by the owner on Jan 5, 2022. It is now read-only.
This repository was archived by the owner on Jan 5, 2022. It is now read-only.

Use with a Webview #123

@Keplyx

Description

@Keplyx

Information

  • react-native version: 0.61.4
  • react-navigation version: ^5.0.9
  • react-navigation-collapsible version: ^5.4.0
  • Platform (iOS/Android): Android (Maybe iOS but couldn't test it)
  • react-native init or Expo: Expo 37

Detail

The library works fine with a FlatList, but I couldn't figure how to make it work with a WebView.
I tried to create an animated view and pass it props like we would do with a FlatList, but the header would not move.

const AnimatedWebView = Animated.createAnimatedComponent(WebView);

const WebViewScreen = ({ navigation }: ScreenProps) => {
  const {
    onScroll,
    containerPaddingTop,
    scrollIndicatorInsetTop,
  } = useCollapsibleStack();

  return (
    <AnimatedWebView
      ref={this.webviewRef}
      onScroll={onScroll}
      contentContainerStyle={{ paddingTop: containerPaddingTop }}
      scrollIndicatorInsets={{ top: scrollIndicatorInsetTop }}
      source={{ uri: 'https://docs.expo.io' }}
    />
  );
};

Am I doing something wrong or is Webview support not implemented?

Snack

You can try the current behavior in this snack (edited from the one in the Readme, web doesn't work for some reason)

Thank you for your time

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions