Related to reactjs events?

I want to use onInput and onKeyDown events on a contenteditable div, Here is my approach

<div
        ref={divRef}
        // value="fudge"
        onInput={handleChangeEventOnInput}
        className="like-input"
        contenteditable="true"
        placeholder="e.g: Feed my cat"
        onKeyDown={handleSubmitEvent}
        // oninput="if(this.innerHTML.trim()==='<br/>')this.innerHTML=''"
      ></div>

onInput works let onChange event on div to track what user type in it and onKeyDown is used to submit for but on both event’s only one event works any way to do this.

According to the docs, the change event doesn’t fire for divs.

Perhaps you could use a blur or a key up event for the same effect.

I made a little pen here.

maybe you mean to use a <textarea>

I wound to use div, but I also want to use textarea and It lot easier to me, but anyway :pensive: