Skip to content Skip to sidebar Skip to footer

React Composition Events

The React docs specifies three 'composition events'. onCompositionEnd onCompositionStart onCompositionUpdate https://facebook.github.io/react/docs/events.html#composition-events W

Solution 1:

Those events would fire when you type non-latin characters like Japanese with IME input to "compose" a word with one or more than two letters. I made a simple demo gif below, please take a look to get a better idea. demo of when CompositionEvent occurs

Solution 2:

The DOM CompositionEvent represents events that occur due to the user indirectly entering text. It is not React's own event.

More info: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent

Post a Comment for "React Composition Events"