I'm currently updating my component to work in Joomla 4, and I've run into an issue with editors. I previously used this:
$editor = JFactory::getEditor();
$editor->display('text', $this->item->text, '', '', '', '', false);
I've since updated to this based one what little I could find:
use Joomla\CMS\Editor\Editor;
use Joomla\CMS\Factory;
$user = Factory::getUser();
$editor = Editor::getInstance($user->getParam('editor', Factory::getConfig()->get('editor')));
$editor->display('text', $this->item->text, '', '', '', '', false);
I'm fully unaware of what I'm doing wrong, but the end result is I have the desired editor with a second editor nested inside.