i6mi6 / react-native-parallax-scroll-view

A ScrollView-like component with parallax and sticky header support.
ISC License
2.31k stars 379 forks source link

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

Open mx-kshitij opened 2 years ago

mx-kshitij commented 2 years ago

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 commented 2 years ago

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 (

); };

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