react-native-floating-label-input icon indicating copy to clipboard operation
react-native-floating-label-input copied to clipboard

Add array notation on styles props

Open sebasbeleno opened this issue 3 years ago • 3 comments

Hey There o/

When I try to use array notation on containerStyle I receive a typescript error.

Type '({ borderWidth: number; paddingHorizontal: number; borderColor: string; borderRadius: number; marginBottom: number; } | { height: number | null; })[]' has no properties in common with type 'ViewStyle'.

<FloatingLabelInput
    onBlur={onBlur}
    onChangeText={_value => onChange(_value)}
    value={value}
    label="Email"
    keyboardType="email-address"
    staticLabel
    containerStyles={[
        styles.inputContainer,
         {height: getFloatingInputHeight()},
    ]}
    customLabelStyles={{
        colorFocused: Colors.acent.brand,
        colorBlurred: Colors.neutral.white,
        fontSizeFocused: 12,
     }}
     labelStyles={styles.inputLabel}
     inputStyles={styles.inputStyle}
 />

The app runs correctly with the previous code but its annoying the ts error.

Note: I already fixed it on my local machine but I don't have permissions to send my branch :/

sebasbeleno avatar Nov 06 '22 03:11 sebasbeleno

Hi @sebasbeleno, thanks for the heads up! Can you please open a PR to fix this? You could instead pass your styles like:

containerStyles={{
        ...styles.inputContainer,
         height: getFloatingInputHeight()
    }}

Cnilton avatar Nov 06 '22 23:11 Cnilton

Hey @Cnilton

I've got this error when I try to push my branch, Do you have any idea what could be wrong?

image

sebasbeleno avatar Nov 07 '22 07:11 sebasbeleno

@sebasbeleno you have to fork it first and then push it to your own repo, and then open the MR

Cnilton avatar Nov 15 '22 21:11 Cnilton