|
|
|
|
|
|
|
|
|
|
|
|
|
|
import he from 'he'; |
|
|
import he from 'he'; |
|
|
const RichComponent: React.FC<RichModelProps> = ({ defaultValue,placeholder, onChange }) => { |
|
|
const RichComponent: React.FC<RichModelProps> = ({ defaultValue,placeholder, onChange }) => { |
|
|
const [editorValue, setEditorValue] = useState(he.decode(defaultValue)); |
|
|
|
|
|
|
|
|
const [editorValue, setEditorValue] = useState(defaultValue ? he.decode(defaultValue) : defaultValue); |
|
|
|
|
|
|
|
|
const handleChange = (content) => { |
|
|
const handleChange = (content) => { |
|
|
setEditorValue(content); |
|
|
setEditorValue(content); |