Skip to content

Undefined is not a function (near '...interpolate...') #133

Description

@Isaccobosio

Bug

BUG: Even if I copied and pasted the example I facing Undefined is not a function (near '...interpolate...')

Screenshot

image

Environment info

Library Version
@gorhom/animated-tabbar ^2.1.2
react-native 0.66.4
react-native-reanimated ^2.3.1
react-native-gesture-handler ^2.1.0
react-native-svg ^12.1.1

Steps To Reproduce

HomeSVG.js

import * as React from 'react';
import Animated from 'react-native-reanimated';
import Svg, { Path } from 'react-native-svg';

const AnimatedPath = Animated.createAnimatedComponent(
  Path
);

Animated.addWhitelistedNativeProps({
  stroke: true,
});

const HomeSVG = ({ color, size }) => {
  return (
    <Svg width={size} height={size} viewBox="0 0 24 24">
      <AnimatedPath
        d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"
        stroke={color}
        strokeWidth={2}
        fill="none"
        fillRule="evenodd"
        strokeLinecap="round"
        strokeLinejoin="round"
      />
    </Svg>
  );
};

export default HomeSVG;

MyTabBar.js

const tabs = {
    Home: {
      labelStyle: {
        color: '#5B37B7',
      },
      icon: {
        component: HomeSVG,
        activeColor: 'rgba(91,55,183,1)',
        inactiveColor: 'rgba(0,0,0,1)',
      },
      background: {
        activeColor: 'rgba(223,215,243,1)',
        inactiveColor: 'rgba(223,215,243,0)',
      },
    },
    Likes: {
      labelStyle: {
        color: '#C9379D',
      },
      icon: {
        component: HomeSVG,
        activeColor: 'rgba(201,55,157,1)',
        inactiveColor: 'rgba(0,0,0,1)',
      },
      background: {
        activeColor: 'rgba(247,215,243,1)',
        inactiveColor: 'rgba(247,215,243,0)',
      },
    },
  };

  return (
    <View style={
      tabBarIsVisible
        ? Platform.select({
          'ios': styles.containerTabiOS,
          'android': styles.containerTabAndroid
        })
        : styles.hideTabBar}>
      <AnimatedTabBarView
        preset="bubble"
        tabs={tabs}
        itemOuterSpace={{
          horizontal: 6,
          vertical: 12,
        }}
        itemInnerSpace={12}
        iconSize={20}
        style={styles.tabBarContainer}
        index={activeTab}
        onIndexChange={onTabSelected}
        // onLongPress={handleLongPress}
      />
    </View>
  );

Describe what you expected to happen:

  1. Should works as example

Thanks <3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions