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

Attempting to run JS driven animation on animated node that has been moved to "native" earlier by starting an animation with useNativeDriver: true #53

Open
oldschoolstarsman66 opened this issue Jan 31, 2023 · 3 comments

Comments

@oldschoolstarsman66
Copy link

I am trying to implement the same appBar bottom variant as in https://www.react-native-material.com/docs/components/app-bar#bottom-app-bar and I am getting the following error:
Attempting to run JS driven animation on animated node that has been moved to "native" earlier by starting an animation with useNativeDriver: true
I cannot find any solution to this problem online. Any help would be appreciated.

Here is my App component
import { AppBar, IconButton, FAB } from "@react-native-material/core";
import Icon from "@expo/vector-icons/MaterialCommunityIcons";

export default function App() {
  return (
    <>
      <AppBar
        variant="bottom"
        color="white"
        leading={(props) => (
          <IconButton
            icon={(props) => <Icon name="menu" {...props} />}
            {...props}
          />
        )}
        trailing={(props) => (
          <IconButton
            icon={(props) => <Icon name="magnify" {...props} />}
            {...props}
          />
        )}
        style={{ position: "absolute", start: 0, end: 0, bottom: 0 }}
      >
        <FAB
          color="black"
          icon={(props) => <Icon name="plus" {...props} />}
          style={{ position: "absolute", top: -28, alignSelf: "center" }}
        />
      </AppBar>
    </>
  );
}
@migfabio
Copy link

migfabio commented Feb 6, 2023

I have the same issue here

@oldschoolstarsman66
Copy link
Author

oldschoolstarsman66 commented Feb 6, 2023

damn, my issue was gone a moment and is now back. it seems to happen with the Fab button.
i ended up creating my own Fab button :)

@szchiki
Copy link

szchiki commented Feb 18, 2023

Looks like there's a useEffect call in the FAB component which creates a non-native animation.

Changing animation to useNativeDriver:true solves the issue for me.

This PR could help other users get more control: #55

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

3 participants