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

Can anyone help? #236

Open
thegirlyoucallryan opened this issue Feb 25, 2022 · 2 comments
Open

Can anyone help? #236

thegirlyoucallryan opened this issue Feb 25, 2022 · 2 comments

Comments

@thegirlyoucallryan
Copy link

import { useEffect } from 'react';
import { Text, StyleSheet, Animated, Platform, Easing,} from 'react-native';

const RowAnimate = props => {

const {data, _active} = props;

useEffect(() => {
    if (props._active !== nextProps._active) {
        Animated.timing(_active, {
          duration: 300,
          easing: Easing.bounce,
          toValue: Number(nextProps._active),
        }).start();
      }

},[nextProps])

return(
    <Animated.View style={[
        styles.animationStyle,
      ]}>
     
        <Text >{data.name}</Text>
      </Animated.View>
    
  

)

};

const styles = StyleSheet.create({
animationStyle : {
...Platform.select({
ios: {
transform: [{
scale: this._active.interpolate({
inputRange: [0, 1],
outputRange: [1, 1.1],
}),
}],
shadowRadius: this._active.interpolate({
inputRange: [0, 1],
outputRange: [2, 10],
}),
},

      android: {
        transform: [{
          scale: this._active.interpolate({
            inputRange: [0, 1],
            outputRange: [1, 1.07],
          }),
        }],
        elevation: this._active.interpolate({
          inputRange: [0, 1],
          outputRange: [2, 6],
        }),
      },
    })
  }

});

export default RowAnimate;

import {
Animated,
Easing,
Dimensions,
Platform,
} from 'react-native';
import RowAnimate from '../components/Row';

const window = Dimensions.get('window');

const FavoritesScreen = props => {
const favorites = useSelector(state => state.favorites.favoritedExercises);

  const _active = new Animated.Value(0);

 const WorkoutRenderHandler = ({favorites, _active}) => {
    return(
     <RowAnimate data={favorites} active={_active} />
    )
  
};



return ( 
     
      <View>
           <SortableList
            style={styles.screen}
            contentContainerStyle={styles.contentContainer}
            data={favorites}
            renderRow={WorkoutRenderHandler} 
            />
)

};

errors:::

TypeError: undefined is not an object (evaluating 'this._active.interpolate')
at node_modules\react-native\Libraries\LogBox\LogBox.js:149:8 in registerError
at node_modules\react-native\Libraries\LogBox\LogBox.js:60:8 in errorImpl
at node_modules\react-native\Libraries\LogBox\LogBox.js:34:4 in console.error
at node_modules\expo\build\environment\react-native-logs.fx.js:27:4 in error
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:104:6 in reportException
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:172:19 in handleException
at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:24:6 in handleError
at node_modules@react-native\polyfills\error-guard.js:49:36 in ErrorUtils.reportFatalError
at node_modules\metro-runtime\src\polyfills\require.js:204:6 in guardedLoadModule
at http://192.168.1.15:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:295266:3 in global code

Invariant Violation: "main" has not been registered. This can happen if:

  • Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
  • A module failed to load due to an error and AppRegistry.registerComponent wasn't called.
    at node_modules\react-native\Libraries\LogBox\LogBox.js:149:8 in registerError
    at node_modules\react-native\Libraries\LogBox\LogBox.js:60:8 in errorImpl
    at node_modules\react-native\Libraries\LogBox\LogBox.js:34:4 in console.error
    at node_modules\expo\build\environment\react-native-logs.fx.js:27:4 in error
    at node_modules\react-native\Libraries\Core\ExceptionsManager.js:104:6 in reportException
    at node_modules\react-native\Libraries\Core\ExceptionsManager.js:172:19 in handleException
    at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:24:6 in handleError
    at node_modules@react-native\polyfills\error-guard.js:49:36 in ErrorUtils.reportFatalError
    at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:367:8 in __guard
    at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:112:4 in callFunctionReturnFlushedQueue
@thegirlyoucallryan
Copy link
Author

import { AppRegistry } from 'react-native';
import App from './App';

AppRegistry.registerComponent('fitness', () => App);

i created an index.js file in the root directory and added this. but no go... my app.json file:

{
"expo": {
"name": "fitness",
"slug": "fitness",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},

"updates": {
  "fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
  "**/*"
],
"ios": {
  "supportsTablet": true
},
"android": {
  "adaptiveIcon": {
    "foregroundImage": "./assets/adaptive-icon.png",
    "backgroundColor": "#FFFFFF"
  }
},
"web": {
  "favicon": "./assets/favicon.png"
}

}
}

@YCMitch
Copy link

YCMitch commented May 16, 2022

Honestly I think this package is abandoned now unfortunately. You may have better luck with this one: https://www.npmjs.com/package/advanced-react-native-sortable-list

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