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

flex doesn't works ? #193

Open
fatoldsun00 opened this issue Nov 15, 2021 · 2 comments
Open

flex doesn't works ? #193

fatoldsun00 opened this issue Nov 15, 2021 · 2 comments

Comments

@fatoldsun00
Copy link

Hi,

i try to make 3 or more rectangle inline, i.e. flex row style. but this code doesn't works

    <Placeholder style={{flex:1, flexDirection: 'row'}}
              Animation={Shine}>
              <PlaceholderLine height={150} style={{ backgroundColor: "red" }}/>
              <PlaceholderLine height={150} style={{ backgroundColor: "red" }}/>
              <PlaceholderLine height={150} style={{ backgroundColor: "red" }}/>

   </Placeholder>

How i can display loaders like in horizontal flatlist ?

Thanks

@R4Y-R4Y
Copy link

R4Y-R4Y commented Nov 27, 2022

anyone got into the issue?

@R4Y-R4Y
Copy link

R4Y-R4Y commented Nov 27, 2022

solved the issue by adding a view in the Placeholder component like this

<Placeholder Animation={ShineOverlay}>
    <View style={{display:"flex",flex:1,flexDirection:"row"}}>
        <PlaceholderMedia style={style.skeleton}></PlaceholderMedia>
        <PlaceholderMedia style={style.skeleton}></PlaceholderMedia>
        <PlaceholderMedia style={style.skeleton}></PlaceholderMedia>
    </View>
</Placeholder> 

the issue seems to be because the Placeholder component doesn't export a style prop in thte typescript and that would make it unable to do any styling inside of it

import React from "react";
import { ViewProps } from "react-native";
export interface PlaceholderProps extends ViewProps {
    Animation?: React.ComponentType;
    Left?: React.ComponentType<ViewProps>;
    Right?: React.ComponentType<ViewProps>;
}
export declare const Placeholder: React.FC<PlaceholderProps>;

until a fix happens here's a way to do it :)

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