()
| 6 | const textareaRef = useRef<HTMLTextAreaElement>(null); |
| 7 | |
| 8 | function onClick() { |
| 9 | if(!textareaRef.current) { |
| 10 | return ; |
| 11 | } |
| 12 | |
| 13 | const res = transform(textareaRef.current.value, { |
| 14 | presets: ['react', 'typescript'], |
| 15 | filename: 'guang.tsx' |
| 16 | }); |
| 17 | console.log(res.code); |
| 18 | } |
| 19 | |
| 20 | const code = `import { useEffect, useState } from "react"; |
| 21 |
nothing calls this directly
no test coverage detected