I copy the demo code , but it doesn't run well in React.
react version is the latest.
node version is 17.0.2.
const Jp = () => {
let [id,]=React.useState('')
// Instantiate
React.useEffect(() => {
demo()
}, [id]);
async function demo (params) {
const kuroshiro = new Kuroshiro();
// Initialize
// Here uses async/await, you could also use Promise
await kuroshiro.init(new KuromojiAnalyzer());
// Convert what you want
const result = await kuroshiro.convert("感じ取れたら手を繋ごう、重なるのは人生のライン and レミリア最高!", { to: "hiragana" });
console.log(result)
}
return
I copy the demo code , but it doesn't run well in React. react version is the latest. node version is 17.0.2. const Jp = () => { let [id,]=React.useState('') // Instantiate React.useEffect(() => { demo() }, [id]);
async function demo (params) { const kuroshiro = new Kuroshiro(); // Initialize // Here uses async/await, you could also use Promise await kuroshiro.init(new KuromojiAnalyzer()); // Convert what you want const result = await kuroshiro.convert("感じ取れたら手を繋ごう、重なるのは人生のライン and レミリア最高!", { to: "hiragana" }); console.log(result) } return
export default Jp;
![捕获](https://user-images.githubusercontent.com/33920719/148052248-9268c67d-0a7a-444e-b7ba-f9d7f7335c07.PNG)