tinymce / tinymce-react

Offical TinyMCE React component
MIT License
959 stars 156 forks source link

upon assigning typescript react selector, throws unable to assign string to undefined init #422

Closed rahulreddyv closed 1 year ago

rahulreddyv commented 1 year ago

What is the current behavior? [TypeScript] Type 'string' is not assignable to type 'undefined'. 11 | placeholder: "Type Here...", 12 | quickbars_selection_toolbar: 'bold italic | blocks | blockquote | quickimage quicktable quicklink',

13 | selector: "textarea" | ^^^^^^^^ 14 | }} /> 15 | ; 16 | }

Please provide the steps to reproduce and if possible a minimal demo of the problem via codesandbox.io or similar.

What is the expected behavior? it should assign the string to selector on init Which versions of TinyMCE, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE or tinymce-react?

exalate-issue-sync[bot] commented 1 year ago

Ref: INT-3074

rahulreddyv commented 1 year ago

Also it blurts all these: TypeError: Cannot read properties of undefined (reading '_owner') at t (backend.bundle.js:1:119865) at t (backend.bundle.js:1:122074) at t (backend.bundle.js:1:122074) at t (backend.bundle.js:1:122074) at t (backend.bundle.js:1:122074) at t (backend.bundle.js:1:122074) at t (backend.bundle.js:1:122074) at t (backend.bundle.js:1:122074) at t (backend.bundle.js:1:122074) at t (backend.bundle.js:1:122074)

tiny-james commented 1 year ago

The react integration creates the element that the editor is initialized on. For that reason both selector and target are not allowed.

Please see: https://www.tiny.cloud/docs/tinymce/6/react-ref/#init