TL;DR: Introduce a new prop for TextInput component to configure autocomplete/autofill options in a cross-platform fashion.

Long Story:

iOS already supports some degree of auto completion through the usage of textContentType property (and recently added username and password options).

Android Oreo introduced the AutoFill Framework, for secure communication between an app and autofill services (e.g. Password managers). It introduces two new properties for text input elements (TextEdit, Spinner and alikes): autofillHints (accepting constants that range from username and password to credit card number) and importantForAutofill (in short, turn it on or off).

Out-of-the-box, Android Oreo+ already tries to autofill <TextInput> components in React Native apps based on heuristics (on the placeholder text, for example), but there is no way to actually set configuring options.

The quick solution would be to just add an autofillHints property in React Native TextInput, but that doesn't bond well with the cross-platform nature of the library.

Proposal: Adopt HTML's autocomplete attribute. HTML's autocomplete spec can be mapped to Android autofillHints & importantForAutofill and serves as a proper placeholder for autofill/autocomplete in other platforms.

References:

Android AutoFill Framework documentation: https://developer.android.com/guide/topics/text/autofill

HTML autocomplete attribute spec: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls%3A-the-autocomplete-attribute

Related Feature Request: https://react-native.canny.io/feature-requests/p/full-support-for-ios-keychain-password-autofill

Related issue / feature request: facebook/react-native#17097