# Reanimated crash on device: Tried to synchronously call a non-worklet function on the UI thread

> A useAnimatedStyle / useDerivedValue body called a plain module-level helper.

Web page: https://davidewins.com/errors/worklet-calls-non-worklet-helper

React Native. Confirmed fix, 5 June 2026.

Versions: Reanimated 4 / react-native-worklets

Error:

```
[Worklets] Tried to synchronously call a non-worklet function `clamp01` on the UI thread.
```

## Cause

A useAnimatedStyle / useDerivedValue body called a plain module-level helper. Inside a worklet you can only call other worklets, Reanimated built-ins and JS globals. It compiles fine and only crashes on device.

## Fix

Inline the math (`Math.max(0, Math.min(1, x))`), use `interpolateColor` for colours, or compute the value outside the worklet and pass the primitive in. Only add `'worklet'` to a helper if it is pure.

## More React Native errors

- [Screen crashes the whole app: Rendered more hooks than during the previous render](https://davidewins.com/errors/rules-of-hooks-usememo-after-early-return)
- [Feed shows an error state for every address: ReferenceError before initialization](https://davidewins.com/errors/tdz-const-used-in-map-before-declaration)
- [Screen crash: Maximum update depth exceeded](https://davidewins.com/errors/maximum-update-depth-competing-effects)
- [Rows wrapped in <Link asChild> collapse to a tiny height](https://davidewins.com/errors/link-aschild-function-style-dropped)
- [Pressable buttons render invisible: style function fill never applied](https://davidewins.com/errors/uniwind-pressable-double-wrap-drops-style)

[Search all errors](https://davidewins.com/errors)
