Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add array notation on styles props #140

Open
sebasbeleno opened this issue Nov 6, 2022 · 3 comments
Open

Add array notation on styles props #140

sebasbeleno opened this issue Nov 6, 2022 · 3 comments

Comments

@sebasbeleno
Copy link

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 :/

@Cnilton
Copy link
Owner

Cnilton commented Nov 6, 2022

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()
    }}

@sebasbeleno
Copy link
Author

Hey @Cnilton

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

image

@Cnilton
Copy link
Owner

Cnilton commented Nov 15, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants