Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errors with demo #90

Open
GravesDXD opened this issue Jan 4, 2022 · 0 comments
Open

errors with demo #90

GravesDXD opened this issue Jan 4, 2022 · 0 comments

Comments

@GravesDXD
Copy link

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

123
;
};

export default Jp;
![捕获](https://user-images.githubusercontent.com/33920719/148052248-9268c67d-0a7a-444e-b7ba-f9d7f7335c07.PNG)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant