Skip to content

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

Open
@mx-kshitij

Description

@mx-kshitij

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>
          );
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions