useDecorate return default method,not the override in custom in some case
See original GitHub issueDescription user can add decorate method on Editable,and it’s not work with editor’s children because it will use default.
Recording
you can add console.log in use-decorate.ts like this:
export const DecorateContext = createContext<(entry: NodeEntry) => Range[]>( () => { console.log("editor's children call.") return [] } )
Sandbox no Steps no Expectation no Environment
- Slate Version: [e.g. 0.63]
Context not need
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Can We Override Default Method in Java? - GeeksforGeeks
So at that time, one must override either one both the default method otherwise it will result in an error. Case 1: When...
Read more >java - Protect "default" methods from overriding - Stack Overflow
You seem to want a way to write your interface so that implementing classes cannot provide their own implementations of its default methods....
Read more >RRWM reloading system [1.3.0a] [ZS/DEC/SBARINFO] - ZDoom
For advanced coders, ReloadableWeapon provides several virtual methods that can be overridden in derived classes. Code: Select all protected ...
Read more >Idea: allow traits to define un-overridable default methods
The Iterator trait has a bunch of useful default methods. Implementors of the trait can choose to override these default methods to the...
Read more >Extending AngularJS services with the Decorate method - Xebia
“A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Another possible fix would be to change
useChildren
so it wraps each child in aChild
component, and calluseDecorate
etc. inside this component. This would still achieve the goal of https://github.com/ianstormtaylor/slate/issues/3966 since a separate component would be returned for each child; butuseDecorate
would be called at the right time.As far as re-rendering goes, it seem like this approach would be the same as the original
Children
component.Thanks for the explanations!