simple-contenteditable

1.0.3 • Public • Published

simple-contenteditable

A tiny contenteditable controlled component for React. Pass the value and ref as a prop to the component. Example:

const [text, setText] = useState('');
const inputRef = useRef(null);

function handleInput(e) {
  console.log(e.target.innerText);
  setText(e.target.innerText);
}

return (
  <div>
    <ContentEditable
      inputRef={inputRef}
      inputValue={text}
      handleInput={handleInput}
    />
  </div>
);

Readme

Keywords

Package Sidebar

Install

npm i simple-contenteditable

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

2.15 kB

Total Files

4

Last publish

Collaborators

  • alabhyajindal