nandorojo / moti

🐼 The React Native (+ Web) animation library, powered by Reanimated 3.
https://moti.fyi
MIT License
3.9k stars 120 forks source link

MotiPressable doesn't work on IOS Simulator #228

Closed MatteoGauthier closed 1 year ago

MatteoGauthier commented 1 year ago

Is there an existing issue for this?

Current Behavior

The MotiPressable component animation don't play on IOS Simulator but it works on the web version

Expected Behavior

No response

Steps To Reproduce

Just use MotiPressable component

 <MotiPressable

              animate={({ hovered, pressed }) => {
                'worklet'

                return {
                  scale: pressed ? 0.95 : hovered ? 1.1 : 1,
                  rotateZ: pressed ? '0deg' : hovered ? '-3deg' : '0deg',
                }
              }}
              from={{
                scale: 0,
                rotateZ: '0deg',
              }}
              transition={{
                type: 'timing',
                duration: 150,
              }}
              style={sx({
                width: 100,
                height: 100,
                backgroundColor: '#f4a261',
                borderRadius: 10,
                m: 3,
              })}
            >
            </MotiPressable>

Versions

- Moti: 0.19.0-alpha.6
- Reanimated: 2.9.1
- React Native: 0.69.5

Screenshots

No response

Reproduction

npx create-react-native-app -t with-moti

add this code block

 <MotiPressable
              animate={({ hovered, pressed }) => {
                'worklet'

                return {
                  scale: pressed ? 0.95 : hovered ? 1.1 : 1,
                  rotateZ: pressed ? '0deg' : hovered ? '-3deg' : '0deg',
                }
              }}
              from={{
                scale: 0,
                rotateZ: '0deg',
              }}
              transition={{
                type: 'timing',
                duration: 150,
              }}
              style={({
                width: 100,
                height: 100,
                backgroundColor: '#f4a261',
                borderRadius: 10,
                m: 3,
              })}
            >
            </MotiPressable>
nandorojo commented 1 year ago

I think the starter app is outdated. Can you update moti?