WanaKanaReact
React wrapper for WanaKana.js
Example demo
https://wanakanareact.netlify.com
To do
Different options
<WanakanaInput value="konnnichiwa" />
<WanakanaInput to="romaji" value="こんにちわ" />
<WanakanaInput to="hiragana" value="konnnichiwa" />
<WanakanaInput to="katakana" value="TABERU" />
Useful props
Name | Value |
---|
to | kana (default), romaji , hiragana , katakana |
component | any valid dom element (input , textarea , etc) |
To use in a form
import WanakanaInput from 'react-wanakana';
const WanakanaInput = () => {
const [greeting, setGreeting] = useState('こんにちわ');
const handleChange = e => {
setGreeting(e.target.value);
};
return (
<form
onSubmit={(e, values) => {
e.preventDefault();
alert(greeting);
}}
>
<WanakanaInput name="greeting" value={greeting} onChange={handleChange} />
<button type="submit">Submit</button>
</form>
);
};
To develop in storybook
npm run storybook