Closed Velkuss89 closed 1 year ago
Hello everyone,
Thank you for great work, it's really useful component. I have some problem after updating react to latest version, so I am not sure if this is right place to ask a question, but here we go
Here is my Editor control ...
<div style={{ width: width }} className={`${error && (!valueStripped || valueStripped === '') ? classes.errorExists : ''}`}> <Editor value={value} onChange={onChange} disabled={disabled} className={className ?? classes.editorControl} required={required} placeholder={placeholderValue} > <Toolbar> <BtnUndo /> <BtnRedo /> {!disabled && noLink !== 1 ? <BtnLink /> : <></>} { showExtraInfo ? <> <p variant="caption" className={placeholderColor ?? classes.info}> {`${placeholderValue} ${entity ?? ''} *`} </p> <p variant="caption" className={charCounterColor ?? classes.charCounter}>{`${valueStripped?.length === undefined ? 0 : valueStripped?.length}/${maxChars}`}</p> </> : <></> } </Toolbar> </Editor> </div>
but on page load, after update of react i keep getting error in this function
function onTextSelect(event: SyntheticEvent<HTMLElement>) { onSelect?.(event); editorState.update({ $selection: getSelectedNode() }); }
Cannot read properties of null (reading 'htmlMode') at Editor (Editor.tsx:31:1)
Is this something you could help me with?
Thank you
Thank you for the report, I'll try investigate that on this week.
I've added an example in README. You need to wrap the Editor by EditorProvider
That fixed it, no error anymore, thank you!
Hello everyone,
Thank you for great work, it's really useful component. I have some problem after updating react to latest version, so I am not sure if this is right place to ask a question, but here we go
Here is my Editor control ...
but on page load, after update of react i keep getting error in this function
Cannot read properties of null (reading 'htmlMode') at Editor (Editor.tsx:31:1)
Is this something you could help me with?
Thank you