Skip to content

Commit 4ac05ea

Browse files
fix: warning reading value during render (#8)
* fix: reading .value during render * chore: release 0.2.1-beta.0
1 parent 397bbfa commit 4ac05ea

4 files changed

Lines changed: 176 additions & 153 deletions

File tree

example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
},
1111
"dependencies": {
1212
"@expo/metro-runtime": "~4.0.0",
13-
"expo": "^52.0.7",
13+
"expo": "~52.0.20",
1414
"expo-status-bar": "~2.0.0",
1515
"react": "18.3.1",
1616
"react-dom": "18.3.1",
17-
"react-native": "0.76.2",
17+
"react-native": "0.76.5",
1818
"react-native-gesture-handler": "~2.20.2",
1919
"react-native-reanimated": "~3.16.1",
2020
"react-native-web": "~0.19.13"

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pressto",
3-
"version": "0.2.0",
3+
"version": "0.2.1-beta.0",
44
"description": "Some custom react native touchables",
55
"source": "./src/index.tsx",
66
"main": "./lib/commonjs/index.js",
@@ -81,7 +81,7 @@
8181
"react-native": "0.74.5",
8282
"react-native-builder-bob": "^0.30.2",
8383
"react-native-gesture-handler": "~2.16.1",
84-
"react-native-reanimated": "~3.10.1",
84+
"react-native-reanimated": "~3.16.1",
8585
"release-it": "^15.0.0",
8686
"typescript": "^5.2.2"
8787
},

src/pressables/base.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const BasePressable: React.FC<BasePressableProps> = ({
7777
return animationType === 'timing' ? withTiming : withSpring;
7878
}, [animationType]);
7979

80-
const progress = useDerivedValue(() => {
80+
const progress = useDerivedValue<number>(() => {
8181
return withAnimation(active.value ? 1 : 0, config);
8282
}, [config, withAnimation]);
8383

@@ -95,7 +95,7 @@ const BasePressable: React.FC<BasePressableProps> = ({
9595
active.value = true;
9696
if (onPressInProvider != null) runOnJS(onPressInProvider)();
9797
if (onPressIn != null) runOnJS(onPressIn)();
98-
}, [active, enabled.value, onPressIn, onPressInProvider]);
98+
}, [active, enabled, onPressIn, onPressInProvider]);
9999

100100
useAnimatedReaction(
101101
() => {
@@ -148,7 +148,7 @@ const BasePressable: React.FC<BasePressableProps> = ({
148148
return tapGesture;
149149
}, [
150150
active,
151-
enabled.value,
151+
enabled,
152152
enabledProp,
153153
isInScrollContext,
154154
isTapped,

0 commit comments

Comments
 (0)