Skip to content

Incompatibility: React 19 + Expo SDK 54 #97

Description

@martluko

The application crashes completely when captchaRef.current?.show() is called in the ExposureScannerScreen component.

Platform: React Native Expo (iOS/Android)
Environment:

    "@hcaptcha/react-native-hcaptcha": "2.1.0",
    "react": "19.1.0",
    "react-native": "0.81.5",
    "expo": "54.0.0",
    "react-native-modal": "14.0.0-rc.0",
    "react-native-webview": "13.16.0"

Implementation:

  import ConfirmHcaptcha from '@hcaptcha/react-native-hcaptcha';

  const captchaRef = useRef<React.ComponentRef<typeof ConfirmHcaptcha>>(null);

  // Triggers crash on React 19
  captchaRef.current?.show();

  <ConfirmHcaptcha
    hasBackdrop={false}
    ref={captchaRef}
    siteKey={siteKey}
    baseUrl={baseUrl}
    languageCode="en"
    size="invisible"
    onMessage={onCaptchaMessage}
  />

Attempted Workarounds patching with patch-package:

We attempted comprehensive patches to remove PropTypes and fix imports in:

  1. @hcaptcha/react-native-hcaptcha (both Hcaptcha.js and index.js)
  2. react-native-modal (dependency)
  3. react-native-animatable (dependency of modal)

Result: App still crashes silently, likely due to deeper React 19 incompatibilities in the modal rendering or native bridge.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions