react-placeholder
react-placeholder copied to clipboard
Multiple placeholder with animation
Hello how can I have multiple placeholder to point out the list view? the way I achieved this: screen.js
isLoading ? [...Array(5)].map((o, i) => (<LoadingComponent key={i} />)) : (<List />)
and in LoadingComponent (actual code is more complicated):
<div style={styles.wrapper}>
<ReactPlaceholder type='rect' showLoadingAnimation />
<ReactPlaceholder type='text' showLoadingAnimation />
</div>
the problem here is I wanted to have an animation so I used ReactPlaceholder instead of RectShape or TextBlock, so I encounter warning:
The prop `ready` is marked as required in `ReactPlaceholder`
and
The prop `children` is marked as required in `ReactPlaceholder
I could pass null as a child and ready={false} but is there any better solution here?
I had the same issue, was wondering the same