SyntaxFix
Write A Post
Hire A Developer
Questions
This is the is simplest solution that worked for me.
<div contentEditable='true' onInput={e => console.log('Text inside div', e.currentTarget.textContent)} > Text inside div </div>