Skip to content

Commit a3b4e98

Browse files
committed
fix: apply review commments
1 parent 8c976db commit a3b4e98

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/use-spring/README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,14 @@ Applies spring animations to the given value, and updates the goal with the late
1717

1818
### 📘 Example
1919

20-
A button that fades in and out when hovered.
20+
A button changes to the colour of its props.
2121

2222
```tsx
2323
function Button() {
24-
const [springValue, setSpringValue] = useBinding(0)
25-
const hover = useSpring(springValue, config.spring.stiff);
24+
const color = useSpring(props.color, config.spring.stiff);
2625
2726
return (
28-
<textbutton
29-
Event={{
30-
MouseEnter: () => setSpringValue(1),
31-
MouseLeave: () => setSpringValue(0),
32-
}}
33-
Size={new UDim2(0, 100, 0, 100)}
34-
BackgroundTransparency={hover.map((t) => lerp(0.8, 0.5, t))}
35-
/>
27+
<textbutton Size={new UDim2(0, 100, 0, 100)} BackgroundColor3={color} />
3628
);
3729
}
3830
```

0 commit comments

Comments
 (0)