Estoy tratando de implementar dentro de tinymce en React un botón personalizado, que debería alternar el ícono y la etiqueta li.
He intentado esto:
<Editor apiKey={editorApiKey} onInit={(evt, editor) => editorRef.current = editor} . . . editor.ui.registry.addToggleButton('CustomNoneListButton', { text: 'My action', onAction() { editor.execCommand('InsertUnorderedList', false, { 'list-style-type': 'none' }); }, active: true, onSetup: (api) => { const editorEventCallback = (eventApi) => { api.setActive(eventApi.element.nodeName.toLowerCase() === 'li'); }; editor.on('NodeChange', editorEventCallback); return () => { editor.off('NodeChange', editorEventCallback); }; } });Pero no funciona, ¿alguna idea de cómo puedo hacer eso?