You can achieve this by using ref. This is particularly useful when you want to nest an object within the proxy that is not wrapped by the internal proxy (such as storing DOM elements, File objects, and other unstructured data). However, please note that its changes will not be tracked. For more details and considerations, please refer to ref.
<input />
, Input May Be InterruptedBy default, when the state changes, changes are notified asynchronously to achieve a merged update (i.e., batching) effect, optimizing rendering.
If you want to disable it (for example, when used by an <input />
element, it may conflict with the input method's Composition events), you can set the sync
option to true
when using store.useSnapshot
to notify changes synchronously, avoiding this problem.