react-vim-wasm
React ComponentとHookが提供されている
↓vim.wasmとvim.dataを用意していないので動かない
code:sample.js
import {html} from '../htm@3.0.4%2Fpreact/script.js';
import {useState} from '../preact@10.5.13/hooks.js';
import {useVim} from '../react-vim-wasm@0.1.4/script.js';
const App = () => {
worker: '/path/to/vim-wasm/vim.js',
// The same as <Vim/> props...
onVimExit: s => alert(Vim exited with status ${s}),
onFileExport: (f, buf) => console.log('file exported:', f, buf),
onError: e => alert(Error! ${e.message}),
});
// Access to vim instance if you want
// Set refs to render screen and handle key inputs
return html<canvas ref="${canvasRef}" /><input ref="${inputRef}" />;
};