You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Slate with Next(React) to create an editor. I have a custom element defined in the following manner.
// Base Element typeexporttypeCustomBaseElement={type: string;
children: CustomDescendant[];
notes: string[];};
So apart from children, I have a notes property in my custom element with a string array. I have created my custom UI elements (textarea) to render the notes. I am updating the editor on the textarea event like so
When I update any children on an element, slates useSlate lets me re-render the context and update any components that depend on it. e.g. a button activates only when there is a change in the editor. However, when I update the notes property, it does not update the editor context. How can I implement the same behaviour with notes?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am using Slate with Next(React) to create an editor. I have a custom element defined in the following manner.
So apart from children, I have a
notes
property in my custom element with a string array. I have created my custom UI elements (textarea) to render thenotes
. I am updating the editor on the textarea event like soWhen I update any children on an element, slates useSlate lets me re-render the context and update any components that depend on it. e.g. a button activates only when there is a change in the editor. However, when I update the
notes
property, it does not update the editor context. How can I implement the same behaviour with notes?Beta Was this translation helpful? Give feedback.
All reactions