MCPcopy
hub / github.com/preactjs/preact / Contenteditable

Function Contenteditable

demo/contenteditable.jsx:3–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import { useState } from 'preact/hooks';
2
3export default function Contenteditable() {
4 const [value, setValue] = useState("Hey there<br />I'm editable!");
5
6 return (
7 <div>
8 <div>
9 <button onClick={() => setValue('')}>Clear!</button>
10 </div>
11 <div
12 style={{
13 border: '1px solid gray',
14 padding: '8px',
15 margin: '8px 0',
16 background: 'white'
17 }}
18 contentEditable
19 onInput={e => setValue(e.currentTarget.innerHTML)}
20 dangerouslySetInnerHTML={{ __html: value }}
21 />
22 </div>
23 );
24}

Callers

nothing calls this directly

Calls 2

useStateFunction · 0.90
setValueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…