react-native-parallax-scroll-view icon indicating copy to clipboard operation
react-native-parallax-scroll-view copied to clipboard

TypeError: undefined is not an object (evaluating 'component.displayName')

Open mx-kshitij opened this issue 2 years ago • 1 comments

Hi,

I tried to use this lib in a native widget that I am working on. Tried to use the code from "basic usage" and am getting the error - TypeError: undefined is not an object (evaluating 'component.displayName')

import { Text, TextStyle, View, ViewStyle } from "react-native";

import { Style } from "@mendix/pluggable-widgets-tools";

import { ParallaxEffectProps } from "../typings/ParallaxEffectProps";
import ParallaxScrollView from 'react-native-parallax-scroll-view';

export interface CustomStyle extends Style {
    container: ViewStyle;
    label: TextStyle;
}

export class ParallaxEffect extends Component<ParallaxEffectProps<CustomStyle>> {
    render(): ReactNode {
        return (
            <ParallaxScrollView
              backgroundColor="blue"
              contentBackgroundColor="pink"
              parallaxHeaderHeight={300}
              renderForeground={() => (
               <View style={{ height: 300, flex: 1, alignItems: 'center', justifyContent: 'center' }}>
                  <Text>Hello World!</Text>
                </View>
              )}>
              <View style={{ height: 500 }}>
                <Text>Scroll me</Text>
              </View>
            </ParallaxScrollView>
          );
    }
}

mx-kshitij avatar Jan 11 '22 09:01 mx-kshitij