Skip to content

how to set custom style in html #277

@callmeguaishu

Description

@callmeguaishu

const text = useRef('<p style={{color:'red'}}>123</p>'); const handleChange = evt => { text.current = evt.target.value; }; const handleBlur = () => { console.log(text.current); }; return <ContentEditable html={text.current} onBlur={handleBlur} onChange={handleChange} />

when I try to set custom style for html content, the 'style={{color:'red'}}' don't work, is that a bug ? what should I do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions