Skip to content
Open
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
2 changes: 1 addition & 1 deletion docs/en/react/main-thread-script.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Synchronizing events using main thread script is very simple. Here we try to mod
First, we inform the framework that we want to handle this event on the main thread by adding a main-thread namespace to the event attribute name:

```tsx
<view main-thread:global-bindscroll={onScroll} />
<view main-thread:bindscroll={onScroll} />
```

Since the onScroll function is now a main thread event handler, we also need to declare the event handler as a main thread function.
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/react/main-thread-script.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { Go } from '@lynx';
首先,我们通过在事件属性名称中添加 `main-thread` 命名空间来通知框架我们想要在主线程上处理此事件:

```tsx
<view main-thread:global-bindscroll={onScroll} />
<view main-thread:bindscroll={onScroll} />
```

我们还需要将 `onScroll` 函数声明为主线程函数。实现方式是:在函数体的首行添加一个 `'main thread'` 指令。
Expand Down