From cc2000b5836a73c2cf57c9245595effa052a30c3 Mon Sep 17 00:00:00 2001 From: Sunny Hirai Date: Thu, 13 Apr 2023 09:13:19 -0700 Subject: [PATCH] Provide a more detailed description of useSlateSelector in docs --- docs/libraries/slate-react/hooks.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/libraries/slate-react/hooks.md b/docs/libraries/slate-react/hooks.md index 2944b67ab..539241fce 100644 --- a/docs/libraries/slate-react/hooks.md +++ b/docs/libraries/slate-react/hooks.md @@ -44,7 +44,9 @@ Get the current editor selection from the React context. Only re-renders when th Similar to `useSlateSelection` but uses redux style selectors to prevent rerendering on every keystroke. -Bear in mind rerendering can only prevented if the returned value is a value type or for reference types (e.g. objects and arrays) add a custom equality function. +Returns a subset of the full selection value based on the `selector`. + +Bear in mind rerendering can only prevented if the returned value is a value type or for reference types (e.g. objects and arrays) add a custom equality function for the `equalityFn` argument. Example: