diff --git a/App.tsx b/App.tsx new file mode 100644 index 000000000..e2fdb4f3e --- /dev/null +++ b/App.tsx @@ -0,0 +1,41 @@ +import { useState } from 'react' + +function Editor() { + const [text, setText] = useState('') + const [msg, setMsg] = useState('') + + function handleChange(e: any) { + setText(e.target.value) + } + + async function saveText() { + const res = await fetch('http://localhost:3000/save', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ text: text }) + }) + const data = await res.json() + if (data.msg == 'saved') { + setMsg('saved!') + } + } + + return ( +
+

Vi-Notes

+