When you want to read a signal value within a component without having fine-grained reactivity.
Note
This is an alternative API to ReactiveText and should only be used in very specific use cases.
The useRead hook was created to provide low-level access control for signals.
By utilizing this hook, you are opting out of fine-grained reactivity and other
performance enhancing benefits.
Warning
This API should be used sparingly and only for very specific use cases where you know what you are doing.
Note
We always recommend utilizing ReactiveText over useRead to provide better control over React rendering in addition to a cleaner DX.
useRead accepts the following options:
| Params | Required | Description |
|---|---|---|
accessor | true | The signal Accessor value to subscribe to. |
useRead returns the latest value of the signal Accessor.
Count:
0Render Count:
2