Skip to content

Commit e1acd3a

Browse files
docs: remove example animations from README for clarity
1 parent 1fa6d44 commit e1acd3a

1 file changed

Lines changed: 0 additions & 27 deletions

File tree

README.md

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -84,33 +84,6 @@ const PressableRotate = createAnimatedPressable((progress) => {
8484

8585
**The `progress` parameter** goes from `0` (idle) to `1` (pressed), allowing you to interpolate any style property.
8686

87-
### More Examples
88-
89-
**Color change:**
90-
91-
```jsx
92-
import { interpolateColor } from 'react-native-reanimated';
93-
94-
const PressableColor = createAnimatedPressable((progress) => {
95-
'worklet';
96-
return {
97-
backgroundColor: interpolateColor(progress, [0, 1], ['#3B82F6', '#1D4ED8']),
98-
};
99-
});
100-
```
101-
102-
**Combined animations:**
103-
104-
```jsx
105-
const PressableCombo = createAnimatedPressable((progress) => {
106-
'worklet';
107-
return {
108-
transform: [{ scale: 1 - progress * 0.1 }],
109-
opacity: 1 - progress * 0.3,
110-
};
111-
});
112-
```
113-
11487
> **⚠️ Important:** The `'worklet';` directive is **required** at the start of your animation function. Without it, animations won't run on the UI thread.
11588
>
11689
> **Tip:** Install [eslint-plugin-pressto](https://github.com/enzomanuelmangano/pressto/tree/main/eslint-plugin-pressto) to catch missing `'worklet'` directives at development time.

0 commit comments

Comments
 (0)