Add array notation on styles props
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 :/
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()
}}
Hey @Cnilton
I've got this error when I try to push my branch, Do you have any idea what could be wrong?
@sebasbeleno you have to fork it first and then push it to your own repo, and then open the MR