Skip to content

Commit 0c2c7f2

Browse files
committed
Add supportsMicrotask to react-reconciler README
1 parent 5a653de commit 0c2c7f2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/react-reconciler/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,12 @@ You can proxy this to `clearTimeout` or its equivalent in your environment.
203203

204204
This is a property (not a function) that should be set to something that can never be a valid timeout ID. For example, you can set it to `-1`.
205205

206+
#### `supportsMicrotask`
207+
208+
Set this to true to indicate that your renderer supports `scheduleMicrotask`. We use microtasks as part of our discrete event implementation in React DOM. If you're not sure if your renderer should support this, you probably should. The option to not implement `scheduleMicrotask` exists so that platforms with more control over user events, like React Native, can choose to use a different mechanism.
206209
#### `scheduleMicrotask(fn)`
207210

208-
You can proxy this to `queueMicrotask` or its equivalent in your environment.
211+
Optional. You can proxy this to `queueMicrotask` or its equivalent in your environment.
209212

210213
#### `isPrimaryRenderer`
211214

0 commit comments

Comments
 (0)