CaioQuirinoMedeiros / react-native-currency-input

A simple currency input component for both iOS and Android
https://www.npmjs.com/package/react-native-currency-input
MIT License
158 stars 25 forks source link

Would be really useful to pass the TextInput component to use #25

Open chrishenx opened 2 years ago

chrishenx commented 2 years ago

Adding an optional prop to specify the input component to render would be a super nice addition to use any input out there, like the one from React Native Elements:

Seems like a small change that would allow several uses cases for integration with other UI libraries.

import View from "react-native";
import CurrencyInput from "react-native-currency-input";
import { Input } from "@rneui/themed";

function MyComponent() {
    return (
        <View>
            <CurrencyInput
              prefix="$ "
              onBlur={onBlur}
              onChangeValue={onChange}
              value={value}
              style={styles.input}
              inputComponent={Input}
            />
        </View>
    );
}
nandorojo commented 1 year ago

you can do this now, right? renderTextInput={props => <Input {...props />}