I have a blog post about that
https://www.great-white-software.com/blog/2019/06/17/follow-up-on-why-shadowing-should-be-avoided/
- subclass text area
- define a new computed property - Text
- the setter then calls the code to start the edit above, sets the Supers text (as demonstrated in my blog post), the end the edit
- same for StyledText maybe or RTF text etc