JSPM

react-wanakana

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q22493F
  • License MIT

A React wrapper for WanaKana.js

Package Exports

  • react-wanakana

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-wanakana) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

WanaKanaReact

React wrapper for WanaKana.js

Currently available

RomajiInput - uses toKana behind the scenes to update an input's value from romaji to hiragana/katakana

To do

  • Add ability to use a custom component (input, textarea, CustomInput)
  • Implement toHiragana input
  • Implement toKatakana input
  • Implement toRomaji input

To use in a form

const RomajiForm = () => {
  const [greeting, setGreeting] = useState('こんにちわ');
  const handleChange = e => {
    setGreeting(e.target.value);
  };

  return (
    <form
      onSubmit={(e, values) => {
        e.preventDefault();
        alert(greeting);
      }}
    >
      <RomajiInput name="greeting" value={greeting} onChange={handleChange} />
      <button type="submit">Submit</button>
    </form>
  );
};

To develop in storybook

npm run storybook