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

Sending 'onAnimatedValueUpdate' with no listeners registered error on Material Top Tabs Navigator #62

Closed
kurucaner opened this issue Mar 29, 2024 · 2 comments

Comments

@kurucaner
Copy link
Contributor

kurucaner commented Mar 29, 2024

Issue:
When using the Material Top Tabs Navigator from React Navigation, an error is encountered when trying to swipe on star icons. I still see the same error displaying even after adding enableSwiping={false} as a prop.

Note: I didn't encounter this issue on other screen types.

Example video:
https://github.com/bviebahn/react-native-star-rating-widget/assets/86489794/d117b209-18a5-4d15-bf38-ebb0175357a0

Example code:

import { createMaterialTopTabNavigator } from "@react-navigation/material-top-tabs";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";

const TopTab = createMaterialTopTabNavigator();
const Tab = createBottomTabNavigator();

const TopTabScreen1 = () => {
  return (
    <View
      style={{
        flex: 1,
        justifyContent: "center",
        alignItems: "center",
      }}
    >
      <Example />
    </View>
  );
};
const Tab2Screen2 = () => {
  return (
    <View>
      <TextInput placeholder="Enter Text" />
    </View>
  );
};
const TabTop = () => {
  return (
    <TopTab.Navigator>
      <TopTab.Screen name="TopTab" component={TopTabScreen1} />
      <TopTab.Screen name="TopTab2" component={Tab2Screen2} />
    </TopTab.Navigator>
  );
};

const Example = () => {
  const [rating, setRating] = useState(0);
  return (
    <StarRating rating={rating} onChange={setRating}  />
  );
};

export default function App() {
  return (
    <NavigationContainer>
      <Tab.Navigator>
        <Tab.Screen
          name="Tab"
          component={TabTop}
          options={{
            headerShown: false,
          }}
        />
        <Tab.Screen
          name="Tab2"
          component={TabTop}
          options={{
            headerShown: false,
          }}
        />
      </Tab.Navigator>
    </NavigationContainer>
  );
}
@bviebahn
Copy link
Owner

bviebahn commented Apr 5, 2024

Sorry for the late reply. I'm also seeing this warning when not rendering any StarRating, so this seems to be not related to this library. Here's an open issue on the react-navigation repo: react-navigation/react-navigation#11564

@kurucaner
Copy link
Contributor Author

Thank you for your time and response.

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