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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
> Reanimated 3 is here! Check out our [documentation page](https://docs.swmansion.com/react-native-reanimated/) for more information

React Native Reanimated provides a more comprehensive,
low level abstraction for the Animated library API to be built
on top of and hence allow for much greater flexibility especially when it
comes to gesture based interactions.
low-level abstraction for the Animated library API on which to build,
allowing for much greater flexibility, especially when it comes to
gesture-based interactions.

### Nightly CI state

Expand Down
10 changes: 5 additions & 5 deletions packages/docs-reanimated/docs/advanced/useEvent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 4

# useEvent

`useEvent` is a low-level hook. It returns event handler that will be called when native event occurs. You can use it to create custom event handler hooks, like [`useScrollViewOffset`](/docs/scroll/useScrollViewOffset/) or [`useAnimatedScrollHandler`](/docs/scroll/useAnimatedScrollHandler/).
`useEvent` is a low-level hook. It returns an event handler that will be called when a native event occurs. You can use it to create custom event handler hooks, like [`useScrollViewOffset`](/docs/scroll/useScrollViewOffset/) or [`useAnimatedScrollHandler`](/docs/scroll/useAnimatedScrollHandler/).

## Reference

Expand Down Expand Up @@ -63,22 +63,22 @@ type EventHandlerProcessed<

#### `handler`

Function that receives event object with native payload, that can be passed to custom handler hook's worklets.
Function that receives an event object with a native payload, which can be passed to the custom handler hook's worklets.

- `event` - event object.
The payload can differ depending on the type of the event.

#### `eventNames` <Optional/>

Array of event names that will be handled by handler.
Array of event names that will be handled by the handler.

#### `rebuild` <Optional/>

Value indicating whether handler should be rebuilt.
Value indicating whether the handler should be rebuilt.

### Returns

The hook returns event handler that will be invoked when native event is dispatched. That handler may be connected to multiple components and will be invoked for each one's specific events.
The hook returns an event handler that will be invoked when a native event is dispatched. That handler may be connected to multiple components and will be invoked for each one's specific events.

## Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ title: useEvent
sidebar_label: useEvent
---

This is low-level hook returning event handler that will be invoked with native events, which should be used in order to create custom event handler hook like `useAnimatedGestureHandler` or `useAnimatedScrollHandler`.
This is a low-level hook returning an event handler that will be invoked with native events, which should be used in order to create custom event handler hooks, like `useAnimatedGestureHandler` or `useAnimatedScrollHandler`.

### Arguments

#### `handler` [function]

Handler will receive event object with native payload, that can be passed to custom handler hook's worklets.
Handler that will receive an event object with a native payload, which can be passed to the custom handler hook's worklets.

- `event` [object] - event object.
The payload can differ depending on the type of the event.
Expand All @@ -21,11 +21,11 @@ Array of event names that will be handled by handler.

#### `rebuilt` [boolean]

Value indicating whether handler should be rebuilt.
Value indicating whether the handler should be rebuilt.

### Returns

The hook returns event handler that will be invoked when native event is dispatched.
The hook returns an event handler that will be invoked when a native event is dispatched.

## Example

Expand Down