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

[0.0.18] invalid value passed to interaction #185

Closed
hirbod opened this issue Mar 29, 2022 · 13 comments
Closed

[0.0.18] invalid value passed to interaction #185

hirbod opened this issue Mar 29, 2022 · 13 comments

Comments

@hirbod
Copy link

hirbod commented Mar 29, 2022

Hi @nandorojo,

tried the Canary and so far, everything was working as expected without breaking changes.
While I tried your release-note example, which was looking dope, I encountered this issue:

<MotiPressable>
  {(interaction) => {
    return (
      <MotiView
        animate={() => {
          'worklet'

          const { pressed, hovered } = interaction.value

          return { opacity: pressed ? 0.9 : 1 }
        }}
      />
    )
  }}
</MotiPressable>

IMG_8611

Some informations:

  • react-native-reanimated v2.5.0
  • react-native-gesture-handler v2.1.1
  • moti v0.18.0-alpha.10
@nandorojo
Copy link
Owner

Hmm weird, thanks for sending. I haven't tried reanimated 2.5 yet, I wonder if that's related (I'm on 2.3).

@hirbod
Copy link
Author

hirbod commented Mar 29, 2022

FYI: if you're using a custom-dev-client like I do, you will need to disable expo autolinking for rea inside the package.json since its not working with 2.5.0 currently.

  "expo": {
    "autolinking": {
      "exclude": [
        "react-native-reanimated"
      ]
    }
  },

@nandorojo
Copy link
Owner

I reproduced this in my app, will investigate.

@nandorojo
Copy link
Owner

Dealing with reanimated internals is tricky! Think I got it, will push shortly.

@hirbod
Copy link
Author

hirbod commented Mar 31, 2022

I am dealing with those internals since 3 days to fix an ugly bug but I am close to give up!
Thanks for investigating

@nandorojo
Copy link
Owner

Hm, reanimated may not allow this specific case for some reason. Going to try to repro and send a PR. Thought I had it working, might have been mistaken.

@nandorojo
Copy link
Owner

It will work for the animate prop, but the child as a function may not work out of the box yet.

@nandorojo
Copy link
Owner

Here is a reproduction that shows it's not possible with Reanimated: https://snack.expo.dev/@beatgig/courageous-bubblegum

Will open an issue there.

@nandorojo
Copy link
Owner

Opened an issue: software-mansion/react-native-reanimated#3123

@nandorojo
Copy link
Owner

Closing for now since it's a reanimated issue. Will make a note of this on the canary release notes.

@hirbod
Copy link
Author

hirbod commented Mar 31, 2022

Closing this will most likely cause duplicate reports, or?

nandorojo added a commit that referenced this issue Mar 31, 2022
@nandorojo
Copy link
Owner

I pushed a fix that solves the animate prop allowing a worklet. As for the MotiPressable child case, I added a note to the release notes:

Screen Shot 2022-03-31 at 6 32 48 PM

@nandorojo nandorojo reopened this Mar 31, 2022
@nandorojo nandorojo changed the title Bug with Canary - invalid value passed to interaction, maybe you forgot to use .value [0.0.18] invalid value passed to interaction Apr 19, 2022
@nandorojo
Copy link
Owner

closing, as we're beholden to reanimated for this to work and it's documented that it isn't ready yet.

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

No branches or pull requests

2 participants