Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleTextInput(view, from, to, text) {
const { state } = view;
const originalTr = state.tr;
let tr: Transaction | undefined;
if (emojiRegex().exec(text)) {
tr = replaceNativeEmoji({ from, to, text, emojiData, type, tr: originalTr }) || tr;
}
if (tr) {
view.dispatch(tr);
return true;
}
return false;
},
},