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 3 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

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 ( <NavigationContainer> <Stack.Navigator> <Stack.Screen name="Home" component={HomeScreen} options={{ title: "Welcome" }} /> <Stack.Screen name="Profile" component={ProfileScreen} /> </Stack.Navigator> </NavigationContainer> ); };

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

and i have done all commands to install the librarys

devuc avatar Nov 10 '22 12:11 devuc