alexZajac / react-native-skeleton-content

A customizable skeleton-like loading placeholder for react native projects using expo.
https://www.npmjs.com/package/react-native-skeleton-content
MIT License
614 stars 134 forks source link

Invariant Violation Error #52

Closed ethan-crabb closed 2 years ago

ethan-crabb commented 3 years ago

Describe the bug When rendering the SkeletonContent component, I receive this error. Invariant Violation: [228,{"type":"value","value":"<<NaN>>"}] is not usable as a native method argument

This error is also thrown prior to the one above Error: Exception in HostFunction: Malformed calls from JS: field sizes are different. [...array of what I assume are module ids]

To Reproduce Steps to reproduce the behavior:

  1. Install react-native-skeleton-content using expo install
  2. Render the component
  3. Observe the error

Expected behavior The component renders with no errors

Smartphone:

Code

import { View, Text } from 'react-native'
import SkeletonContent from "react-native-skeleton-content";

export default function FeedLoading() {
    const MockPost = () => {
        return (
            <SkeletonContent isLoading={true}>

                <Text>
                    Your content
                </Text>

                <Text>
                    Other content
                </Text>

            </SkeletonContent>
        )
    }
    return (
        <View style={{ height: 100, width: "100%" }}>
            <MockPost />
        </View>
    )
}
julius-lae commented 3 years ago

Any updates?

komalharmale commented 3 years ago

Any updates?

hey you didn't have follow installation steps correctly that is the reason your facing these issue step 1: install these libraries npm install react-native-skeleton-content npm install react-native-linear-gradient --save npm install @react-native-masked-view/masked-view --save npm install react-native-reanimated step 2: cd android ./gradlew clean cd .. then run the project

ethan-crabb commented 2 years ago

This works, thanks!

Any updates?

hey you didn't have follow installation steps correctly that is the reason your facing these issue step 1: install these libraries npm install react-native-skeleton-content npm install react-native-linear-gradient --save npm install @react-native-masked-view/masked-view --save npm install react-native-reanimated step 2: cd android ./gradlew clean cd .. then run the project