Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
310 changes: 145 additions & 165 deletions bun.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions example/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ const ScalePressable = memo(function ScalePressable({
style={[style, animatedStyle]}
onPress={onPress}
onPressIn={() => {
scale.value = withSpring(0.96, springSnappy);
scale.set(withSpring(0.96, springSnappy));
}}
onPressOut={() => {
scale.value = withSpring(1, springSnappy);
scale.set(withSpring(1, springSnappy));
}}
>
{children}
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
"devDependencies": {
"@commitlint/cli": "^21.2.3",
"@commitlint/config-conventional": "^21.2.3",
"@eslint/js": "^9.28.0",
"@eslint/js": "^10.0.1",
"@types/react": "^19.2.15",
"eslint": "^9.28.0",
"eslint": "^10.11.0",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"globals": "^16.2.0",
"eslint-plugin-react-hooks": "^7.1.1",
"globals": "^17.12.0",
"husky": "^9.1.7",
"prettier": "^3.9.9",
"typescript": "^5.8.3",
"typescript": "^6.0.3",
"typescript-eslint": "^8.70.1"
}
}
4 changes: 2 additions & 2 deletions package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@
"react-native": "0.86.0",
"react-native-builder-bob": "^0.43.1",
"react-native-nitro-modules": "^0.35.10",
"release-it": "^19.0.0",
"typescript": "^5.8.3"
"release-it": "^21.1.0",
"typescript": "^6.0.3"
},
"react-native-builder-bob": {
"source": "src",
Expand Down
1 change: 1 addition & 0 deletions package/src/camera/useValidCamera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { resolveCameraProp } from './resolveCameraProp';
export function useValidCamera(camera: Camera | undefined): Camera | undefined {
const lastAccepted = useRef<Camera | undefined>(undefined);
const accepted = useMemo(
// eslint-disable-next-line react-hooks/refs -- read only when `camera` changes, as in useValidRegion
() => resolveCameraProp(camera, lastAccepted.current),
[camera],
);
Expand Down
2 changes: 2 additions & 0 deletions package/src/hooks/useCollectedOverlays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ export function useCollectedOverlays(children: ReactNode): CollectedOverlays {
const overlays = useMemo(() => {
const state = collectOverlayChildren(children, { resolveMarkerImage });

/* eslint-disable react-hooks/refs -- the press handlers read the registry of the latest render */
callbackRegistry.current = state.registry;
Comment thread
jkasprzyk17 marked this conversation as resolved.
trackPositionalIds(positionalIds.current, state.ids.anonymous);
/* eslint-enable react-hooks/refs */

return {
markers: state.markers,
Expand Down
1 change: 1 addition & 0 deletions package/src/hooks/useStableValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export function useStableValue<Value>(
isEqual: (left: Value, right: Value) => boolean,
): Value {
const previous = useRef(next);
// eslint-disable-next-line react-hooks/refs -- compares with the last committed value, see above
const stable = isEqual(previous.current, next) ? previous.current : next;

useLayoutEffect(() => {
Expand Down
5 changes: 3 additions & 2 deletions package/src/region/useValidRegion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import { resolveRegionProp } from './resolveRegionProp';
*/
export function useValidRegion(region: Region | undefined): Region | undefined {
const lastAccepted = useRef<Region | undefined>(undefined);
// Reading the ref here is safe: it only matters at the moment `region`
// changes, which is exactly when this recomputes.
const accepted = useMemo(
// Reading the ref here is safe: it only matters at the moment `region`
// changes, which is exactly when this recomputes.
// eslint-disable-next-line react-hooks/refs
() => resolveRegionProp(region, lastAccepted.current),
[region],
);
Expand Down
3 changes: 2 additions & 1 deletion package/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"rootDir": "src",
"outDir": "lib/typescript",
"noEmit": true
"noEmit": true,
"types": ["bun"]
},
"include": ["src"]
}
4 changes: 2 additions & 2 deletions package/tsconfig.plugin.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "../config/tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"module": "node16",
"moduleResolution": "node16",
"rootDir": "plugin/src",
"outDir": "plugin/build",
"noEmit": false,
Expand Down
Loading