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

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

Open
mx-kshitij opened this issue Jan 11, 2022 · 1 comment

Comments

@mx-kshitij
Copy link

mx-kshitij commented Jan 11, 2022

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>
          );
    }
}
@devuc
Copy link

devuc commented Nov 10, 2022

i am also having the same issue with this code :

import { createNativeStackNavigator } from "@react-navigation/native-stack";
import React from "react";
const Stack = createNativeStackNavigator();

export const App = () => {
return (

<Stack.Navigator>
<Stack.Screen
name="Home"
component={HomeScreen}
options={{ title: "Welcome" }}
/>
<Stack.Screen name="Profile" component={ProfileScreen} />
</Stack.Navigator>

);
};

const HomeScreen = ({ navigation }) => {
return (
<Button
title="Go to Jane's profile"
onPress={() => navigation.navigate("Profile", { name: "Jane" })}
/>
);
};
const ProfileScreen = ({ navigation, route }) => {
return This is {route.params.name}'s profile;
};

and i have done all commands to install the librarys

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