tinymce / tinymce-react

Offical TinyMCE React component
MIT License
937 stars 152 forks source link

Changing Theme while the component is on DOM does not work. #460

Closed Manj0tBenipal closed 7 months ago

Manj0tBenipal commented 11 months ago

Changing the theme of the editor requires unmounting and then mounting the editor again.

The live demo of the project is available here

When a prop being passed down to the parent component changes, the parent component runs a useEffect() which changes the init object(stored in the state) passed down to the editor as a prop. However, it does not take effect until the component is unmounted and mounted again.

The browser used for testing is Chrome.

TinyITAdmin commented 11 months ago

Ref: INT-3206

shanmen-tiny commented 7 months ago

Hello @Manj0tBenipal,

This is a known problem. The only workaround is changing the key to force a reinit of the editor. TinyMCE does not support changing the theme without a reinit.