◉RORK LABJP
●SUBDOMAIN — Rork can now connect your web app to a subdomain only, leaving your root domain and www untouched (12/1)●UPDATES — expo-updates 58.0.23 fixes Android release builds embedding a stale runtime version●FLASH END — Intro pricing for Gemini Flash models ends 12/31, 29 days from now. Time to recheck AI feature costs●HMR — Some report the dev server picking up another server's bundle and then exiting●FIRST VIEW — Map the first screen for a normal launch, a notification, and a link, and back navigation stops surprising you●CARBON — Gemini 4 Carbon and Argon are now at standard rates: $4.00 input, $20.00 output per 1M tokens●SUBDOMAIN — Rork can now connect your web app to a subdomain only, leaving your root domain and www untouched (12/1)●UPDATES — expo-updates 58.0.23 fixes Android release builds embedding a stale runtime version●FLASH END — Intro pricing for Gemini Flash models ends 12/31, 29 days from now. Time to recheck AI feature costs●HMR — Some report the dev server picking up another server's bundle and then exiting●FIRST VIEW — Map the first screen for a normal launch, a notification, and a link, and back navigation stops surprising you●CARBON — Gemini 4 Carbon and Argon are now at standard rates: $4.00 input, $20.00 output per 1M tokens
Articles/Dev Tools
⬡ Dev Tools/2026-04-22Intermediate

Fixing Japanese IME Input Issues in Rork Apps: A React Native Deep Dive

Apps generated by Rork often misbehave with Japanese IME input — events fire during composition, candidate windows close unexpectedly. Here's how to diagnose and fix it with working React Native code.

Rork622React Native244Japanese InputIMETextInputTroubleshooting55

A few days after release, I found a one-star review on a Rork-built note-taking app: "can't confirm Japanese conversion, buggy." My stomach dropped. The app had run fine on my English keyboard, so I had no idea where to start looking.

Feedback like "the search box breaks when I type Japanese" or "the conversion closes before I can confirm" usually traces back to one root. The generated code never anticipated Input Method Editors (IMEs), and English-only testing can't reveal that.

Below I use the patterns I see most often in Rork output to walk through how React Native's TextInput behaves during IME composition. Each fix is short enough to apply to your project the same day. The TextInput props and behaviors described here are the ones I checked against the React Native docs and Expo's GitHub issues as of November 2026.

Why events fire during IME composition

React Native's TextInput.onChangeText was designed with alphabet-style input in mind: one keystroke, one character, one event. That model breaks down for Japanese, Chinese, and Korean (CJK) input methods.

When a user types Japanese (iOS keyboards in particular), the IME first shows a "preedit" string — hiragana with an underline, not yet confirmed. Each intermediate character fires onChangeText. Typing "東京駅" might trigger 5 to 10 events before confirmation. Any work you do in that handler runs during composition.

This manifests as:

  • Search boxes firing API calls for every intermediate character, hitting rate limits and producing noisy network logs
  • State updates causing rerenders that close the IME candidate window mid-selection
  • On some keyboards and devices, onSubmitEditing firing when the user hits Enter to confirm a conversion, not to submit

The web platform handles this through compositionstart / compositionupdate / compositionend events, but React Native exposes no equivalent. You have to work around it.

Reproducing the problem

Here's the minimal Rork-style snippet that demonstrates the issue. Try it in a Japanese-enabled simulator or device.

import { useState } from "react";
import { TextInput, View, Text } from "react-native";
 
export default function BrokenSearchBox() {
  const [query, setQuery] = useState("");
  const [callCount, setCallCount] = useState(0);
 
  // ❌ Bad: fires during composition, not just on confirmation
  const handleChange = (text: string) => {
    setQuery(text);
    setCallCount((c) => c + 1);
    console.log("Search API called with:", text);
  };
 
  return (
    <View style={{ padding: 24 }}>
      <TextInput
        value={query}
        onChangeText={handleChange}
        placeholder="Search..."
        style={{ borderWidth: 1, padding: 12, borderRadius: 8 }}
      />
      <Text>API call count: {callCount}</Text>
    </View>
  );
}

Type "東京駅" (Tokyo Station) and callCount can climb into the teens before you confirm; the exact number depends on the device and keyboard settings. A search box that fires that many requests per query isn't shippable.

Fix 1: Debounce the input

The simplest fix is to buffer rapid changes and only act once the user pauses. This doesn't require knowing anything about IMEs — it just smooths out the burst.

import { useState, useRef, useEffect } from "react";
import { TextInput, View, Text } from "react-native";
 
export default function DebouncedSearchBox() {
  const [inputValue, setInputValue] = useState("");
  const [committedQuery, setCommittedQuery] = useState("");
  const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
 
  useEffect(() => {
    if (timerRef.current) clearTimeout(timerRef.current);
    // 300ms of silence counts as "user finished typing"
    timerRef.current = setTimeout(() => {
      setCommittedQuery(inputValue);
    }, 300);
    return () => {
      if (timerRef.current) clearTimeout(timerRef.current);
    };
  }, [inputValue]);
 
  useEffect(() => {
    if (committedQuery.length === 0) return;
    console.log("Search API called (post-commit):", committedQuery);
  }, [committedQuery]);
 
  return (
    <View style={{ padding: 24 }}>
      <TextInput
        value={inputValue}
        onChangeText={setInputValue}
        placeholder="Search..."
        style={{ borderWidth: 1, padding: 12, borderRadius: 8 }}
      />
      <Text>Committed query: {committedQuery}</Text>
    </View>
  );
}

The key move is splitting state into two pieces: inputValue tracks what the user is seeing live, and committedQuery is what the API cares about. The visible text updates freely during IME composition, but the expensive side effect waits for a pause.

Keep what the user sees and what you send outward as two separate pieces of state — every fix below builds on that split.

This isn't a perfect fix, but it's a small diff on top of Rork's generated code and solves the most painful symptom — runaway API calls — in nearly every case.

For a while I assumed debounce had settled the matter. It hadn't. When someone takes their time choosing a conversion candidate, the 300 ms of silence can elapse in the middle of composition, and the search runs on an unconfirmed string. Debounce thins out the events; it can't tell you whether the user is still composing. That distinction is worth keeping in mind.

Count the events on your own device

Rather than trusting my estimate, count on your own hardware. Add a few lines to the search box and the log shows how many notifications arrive mid-conversion, with timestamps.

const startRef = useRef(Date.now());
 
const handleChangeText = (text: string) => {
  const elapsed = Date.now() - startRef.current;
  console.log(`+${elapsed}ms onChangeText:`, JSON.stringify(text));
  setInputValue(text);
};

Type "とうきょうえき", pick a candidate, and confirm. The log shows the unconfirmed kana streaming in one character at a time. The count and spacing you see there are a sensible starting point for choosing your debounce delay.

Fix 2: Submit-only search

If live search isn't essential to your product, consider only firing the search when the user presses Enter. Counterintuitively, this often produces a cleaner UX, because the action matches the user's intent.

import { useState } from "react";
import { TextInput, View, Text } from "react-native";
 
export default function SubmitBasedSearchBox() {
  const [inputValue, setInputValue] = useState("");
  const [results, setResults] = useState<string[]>([]);
 
  const handleSubmit = () => {
    // By this point, IME composition is guaranteed complete
    console.log("Search triggered:", inputValue);
    setResults([`${inputValue} — result 1`, `${inputValue} — result 2`]);
  };
 
  return (
    <View style={{ padding: 24 }}>
      <TextInput
        value={inputValue}
        onChangeText={setInputValue}
        onSubmitEditing={handleSubmit}
        returnKeyType="search"
        placeholder="Type and press Enter"
        style={{ borderWidth: 1, padding: 12, borderRadius: 8 }}
      />
      {results.map((r, i) => (
        <Text key={i}>{r}</Text>
      ))}
    </View>
  );
}

onSubmitEditing fires only when the user presses the return / search key, long after composition finishes. Setting returnKeyType="search" surfaces a magnifying-glass icon on the keyboard, cueing users that this is the moment they run a search. After switching to this pattern in a production app, the "Japanese input broken" complaints completely stopped for me.

Fix 3: Explicit save button for multiline input

For multiline TextInput (notes, journals), a different issue crops up: the "confirm conversion" and "insert newline" keystrokes share the same physical key. Trying to wire "Enter = save" almost always creates accidental conflicts with IME confirmation.

The pragmatic solution is to abandon key-based saving altogether and make the user tap an explicit save button.

import { useState } from "react";
import { TextInput, View, Text, Pressable } from "react-native";
 
export default function MultilineMemoEditor() {
  const [memo, setMemo] = useState("");
  const [saved, setSaved] = useState(false);
 
  const handleSave = () => {
    console.log("Memo saved:", memo);
    setSaved(true);
  };
 
  return (
    <View style={{ padding: 24 }}>
      <TextInput
        value={memo}
        onChangeText={(t) => {
          setMemo(t);
          setSaved(false);
        }}
        multiline
        placeholder="Write a memo..."
        style={{
          borderWidth: 1,
          padding: 12,
          borderRadius: 8,
          minHeight: 120,
          textAlignVertical: "top",
        }}
      />
      <Pressable
        onPress={handleSave}
        style={{
          marginTop: 16,
          padding: 12,
          backgroundColor: "#0066cc",
          borderRadius: 8,
        }}
      >
        <Text style={{ color: "white", textAlign: "center" }}>Save</Text>
      </Pressable>
      {saved && <Text style={{ marginTop: 8 }}>Saved</Text>}
    </View>
  );
}

Yes, it's tempting to let Enter save. But because Enter also confirms Japanese conversion, you will inevitably create false saves or dropped newlines. Explicit actions are friendlier to every input method, not just Japanese.

Stale results arriving late

Even with fewer requests, one symptom remains. The results for "東京駅" come back first, and then the slower results for "東京" land afterward and overwrite the screen. It shows up most on poor connections, which is why it rarely reproduces on office Wi-Fi.

Cancel the previous request just before starting the next one, and the stale response never reaches the screen.

useEffect(() => {
  if (committedQuery.length === 0) return;
  const controller = new AbortController();
 
  fetch(`https://api.example.com/search?q=${encodeURIComponent(committedQuery)}`, {
    signal: controller.signal,
  })
    .then((res) => res.json())
    .then(setResults)
    .catch((e) => {
      if (e.name !== "AbortError") console.warn("Search failed", e);
    });
 
  // Abort the previous request right before committedQuery changes
  return () => controller.abort();
}, [committedQuery]);

The api.example.com URL is a placeholder; swap in your own endpoint.

Don't rewrite the value mid-composition

Debouncing doesn't protect you from one more trap: transforming the text inside onChangeText and feeding the result straight back into value.

// ❌ Trimming or replacing the in-progress string can close the candidate window
<TextInput
  value={value}
  onChangeText={(t) => setValue(t.replace(/\s/g, "").slice(0, 20))}
/>

Do the whitespace stripping and length clamping after confirmation instead. Store what the keyboard hands you as-is while the user types, then tidy it in onEndEditing or when they tap Save. My rule now is simple: leave the visible string alone, and clean up only after it's committed.

Choosing among the three fixes

The choice comes down to whether the screen shows results while you type or only after you decide.

FixBest forWatch out for
Debounce (about 300 ms)Live search that narrows as you typeAdds a delay, and a long conversion can still trigger a search on an intermediate string
Submit via onSubmitEditingOrdinary search where users press the search keyYou give up the live-search feel
Explicit Save buttonMultiline notes and journalsCheck button placement against the keyboard on a real device

Matching the symptom to a cause

What arrives in a review is usually just "it's broken." Narrowing the symptom first tells you where to look, so you fix things in the right order.

SymptomLikely causeHow to checkFix
The search API fires on every keystroke and hits rate limitsAn API call sits directly in onChangeTextUse the event-count log above and see whether unconfirmed hiragana is streaming inMove it behind a debounce or onSubmitEditing
The candidate window closes on its ownHeavy re-renders on every change, or the handler rewrites value and feeds it backRemove the rewrite, echo the raw string back, and see if it still happensClean up after confirmation; for render-heavy screens, consider defaultValue (uncontrolled)
Results appear for a string the user hadn't confirmed yetThe debounce window expires in the middle of a conversionSee whether it only happens when converting slowlyRather than lengthening the delay, switch to search-on-submit
Newer results get overwritten by older onesThe previous request is never cancelledThrottle the network or try on a slow connectionCancel the previous request with AbortController
Enter in a notes field won't add a line break, or submits unexpectedlyA multiline input with submitBehavior set to a submit variantRead the submitBehavior and onSubmitEditing props on that TextInputLeave multiline on its default newline behavior and put saving on a button
An @expo/ui TextField crashes mid-conversion (iOS 18+)A known Expo bug (issue #54364, still open as of November 2026)Look for "Index out of range" in the crash log, occurring only while a Japanese, Chinese or Korean IME is composingUntil a fix ships, use React Native's TextInput on screens where people type Japanese

The rows run from the cheapest check to the most involved. Only the last one is about the component rather than your own code, so it's reasonable to suspect it after the others come up empty.

Three common misconceptions

"If I stop passing value, everything is fixed"

The React Native docs describe defaultValue as the prop for cases where you don't want to keep listening to events and syncing value back. Going uncontrolled does reduce symptoms caused by re-rendering mid-composition, because the parent no longer writes the value back on every change.

The trade-off: clearing the field from outside (after a search, say) becomes a call to ref.current?.clear(), and you can no longer shape what's displayed through value.

import { useRef } from "react";
import { TextInput, Button, View } from "react-native";
 
export default function UncontrolledSearch({ onSearch }: { onSearch: (q: string) => void }) {
  const inputRef = useRef<TextInput>(null);
  const latest = useRef("");
 
  return (
    <View style={{ padding: 24, gap: 12 }}>
      <TextInput
        ref={inputRef}
        defaultValue=""
        onChangeText={(t) => { latest.current = t; }}   // kept on hand, never rendered
        onSubmitEditing={() => onSearch(latest.current)}
        returnKeyType="search"
        style={{ borderWidth: 1, padding: 12, borderRadius: 8 }}
      />
      <Button title="Clear" onPress={() => { inputRef.current?.clear(); latest.current = ""; }} />
    </View>
  );
}

The point is that onChangeText stays, but it writes to a ref rather than state. Nothing re-renders, so the candidate window is left alone. I'd treat this as one option for re-render-driven symptoms, not a cure-all.

"Multiline inputs can still save on Enter"

React Native's submitBehavior defaults to blurAndSubmit for single-line inputs and newline for multiline ones (it replaces the older blurOnSubmit). Switch a multiline input to a submit variant and Enter will call onSubmitEditing — but users can no longer type a line break.

For notes or a journal, losing line breaks is a dealbreaker, which is why Fix 3 moves saving to a button. Keeping "Enter is for line breaks, saving is for the button" also means confirming a conversion and saving never share a key.

"If it works in the simulator, it works on the device"

With a hardware keyboard connected, the iOS Simulator converts through the Mac's input source, and the events can arrive differently from a real device's software keyboard. I once declared a fix done after typing in the simulator, then watched the same bug appear on my phone.

When you test, show the software keyboard in the simulator or, better, use a device — and try both romaji and kana input. On Android, Gboard can deliver a different sequence of events than iOS does.

If you're using @expo/ui's TextField (as of November 2026)

Recent Rork output and Expo templates sometimes reach for @expo/ui's TextField (SwiftUI's TextField on iOS) for a more native look. It comes with caveats separate from React Native's TextInput.

There's an open report on Expo's GitHub that on iOS 18 and later, the @expo/ui TextField crashes with "Index out of range" while a Japanese, Chinese or Korean IME is composing (expo/expo #54364). As of November 2026 I haven't been able to confirm a release that fixes it. If you only test with an English keyboard, you'll essentially never see this one.

There's also a report that with the New Architecture enabled, React Native's TextInput loses the underline on in-progress composition text (expo/expo #38422). It doesn't crash, but it becomes harder to see which part is still unconfirmed.

My own line: on screens where people type Japanese, I stay on React Native's TextInput until those reports are resolved. Conversion that always completes comes before a newer look — for Japanese input fields, I don't let those two swap places. For the broader question of when swapping components is worth it, see when an Expo UI drop-in swap actually removes a dependency.

Prompting Rork for IME-aware code

When you're starting a new Rork project and know your app will be used in Japanese (or Chinese, Korean), bake the constraint into your prompt. I append something like this to any screen that contains text input:

  • "Assume users type with a Japanese IME. On any TextInput, use debounce or onSubmitEditing so side effects don't fire during composition."
  • "For search boxes, don't call the API on onChangeText. Use returnKeyType=\"search\" and fire the search in onSubmitEditing only."
  • "For multiline TextInput, do not bind save or submit to the Enter key. Use an explicit save button."
  • "On screens where users type Japanese, use React Native's TextInput rather than @expo/ui's TextField."

That one paragraph prevents a whole class of post-launch bugs. How you specify the UI text itself — which language, how long — is its own topic, which I covered in asking Rork for the same screen in Japanese and in English. Putting that and the IME assumption into your first prompt saves a round of rework.

Three less obvious IME gotchas

A few more pitfalls that surprised me during production testing:

  1. maxLength counts preedit characters. A maxLength={10} input can sometimes block a conversion because the interim hiragana string runs long before it collapses to a few kanji (behavior varies by device and keyboard). Leave some slack and clamp after confirmation.
  2. Emoji grapheme clusters. Emoji like the family sequence (👨‍👩‍👧‍👦) join several code points. text.length misreports them, and [...text].length still counts code points, not what the user sees. Use Intl.Segmenter where it exists, or a grapheme-splitting library where it doesn't.
  3. Full-width vs half-width for email/password. Without autoCapitalize="none" and keyboardType="email-address", iOS users can accidentally type full-width (zenkaku) characters into credential fields and get baffling auth errors.

A concrete next step

Pick one screen in your current Rork project that uses a TextInput and check whether onChangeText is wired directly to an API call or a heavy state update. If it is, swap it for the debounce or onSubmitEditing pattern from above. For Japanese users, the first thing they notice isn't how many features you shipped but whether conversion goes through cleanly. I always check that feel with my own fingers before release.

Once the search box behaves, the next thing people tend to hit is a search-side problem: two-character queries quietly returning nothing. I walk through measuring that in when two-character queries silently return nothing.

Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

⬡ Dev Tools2026-05-18
Fixing Linking.canOpenURL False Returns on iOS in Rork
TikTok or X buttons doing nothing in production iOS builds, or always falling back to the mobile web? A symptom-by-symptom triage table, the LSApplicationQueriesSchemes fix, how to verify it inside the built binary, a fallback that does not depend on canOpenURL, and the Android 11 queries rule.
⬡ Dev Tools2026-11-04
Catching the Few Seconds Before Streaming Audio Starts: A Loading State and a Timeout
You tap play and nothing happens for a moment. Here is how I model that gap with expo-audio: a requested flag, a 400ms delayed spinner, and an 8-second timeout.
⬡ Dev Tools2026-10-30
It runs in development but the iOS Release build dies on launch — checking whether a missing scheme is the cause
In an expo-router app, an app.json with no scheme can crash only the iOS Release build at launch. A triage table for Release-only crashes, how to read the reason from the log, why Debug and Android survive, the two fixes and why one needs a native rebuild, and a pre-submission check.