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't find variable: performance on React Native (Expo) #1074

Closed
nksaraf opened this issue Jul 3, 2020 · 2 comments
Closed

Can't find variable: performance on React Native (Expo) #1074

nksaraf opened this issue Jul 3, 2020 · 2 comments

Comments

@nksaraf
Copy link

nksaraf commented Jul 3, 2020

🐛 Bug Report

When using v9 rc on react native with @react-spring/native, an error is being thrown in the following simple piece of code. the exception mentions Unhandled promise rejection: Can't find variable: performance

function SearchButton() {
  const navigation = useDrawer();
  const [state, setState] = React.useState("left");

  const styles = useSpring({
    paddingRight: state === "left" ? 20 : 100,
  });

  return (
    <AnimatedView
      // initial={"left"}
      // animate={state}
      style={styles}
    >
      <TouchableWithoutFeedback
        style={{ padding: 16 }}
        onPress={() => setState((s) => (s === "left" ? "right" : "left"))}
      >
        <MaterialIcons name="search" size={28} color={colors.blueGrey[800]} />
      </TouchableWithoutFeedback>
    </AnimatedView>
  );
}

This works with react-spring v8, but throws exception on the latest version on 9 rc.
Screen Shot 2020-07-03 at 1 53 54 PM

Expected behavior

The padding value should animate when the search button is clicked

Link to repro (highly encouraged)

(Please provide either a CodeSandbox demo or an example GitHub repo.)

Environment

  • react-spring v9.0.0-rc.3
  • react-native v0.62 with expo SDK 38
@aleclarson
Copy link
Contributor

Have you tried using an older version of react-native?

facebook/react-native#27885 seems to fix the issue. You could fork react-native and pull those changes in, or wait until they're released.

@nksaraf
Copy link
Author

nksaraf commented Jul 8, 2020

I was using the version that comes with expo SDK 38. I think they have their own patched changes on the react-native version, so I will have to work on their patched version. Not very comfortable working around those things yet. We reverted to using react-spring v8 for now.

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