withOffset(value: Node, state: Node, offset: Node = 0): Node

Decorates animated value to save previous offset of pan

constructor(props) {
const dragX = new Value(0);
const panState = new Value(0);
this.handlePan = event([
{
nativeEvent: {
translationX: dragX,
state: panState,
},
},
]);
this.X = withOffset(dragX, panState);
}