Closed Zeikko closed 3 years ago
Hi Zeikko, Thank you for your contribution.
I'm thinking to use restProps
for missing props (https://reactnative.dev/docs/view) and pass it into View.
What do you think?
Thanks for your reply @tomzaku. Passing more props to view is a great idea! I made a new commit just to make sure i understood what you mean and it works for me. Is this what you meant? I think it's a good solution to my issue but i think it has some issues:
These issues could be prevented using a prop called viewProps
, containerProps
or something similar instead of the restProps.
The restProps also has its benefits and i'm not sure which approach would be the best here.
What shall we do? :)
Using containerProps
is a good idea.
Maybe we only need containerProps
which is replaced restProps and shimmerContainerProps
which is located at 92.
Can you help me add 2 props for this component?
The reason why need to add shimmerContainerProps is for testing if who would like to test the visibility of placeholder
Good point! The shimmerContainerProps
will be relevant when using shimmer to render the children. I also added childrenContainerProps
for consistency. How does it look? Is there still something to improve?
I'm good with this change. I will merge and deploy tmr
Thank you again
Great! Thank you for your work and fast responses! I'm will be waiting for the release.
Actually. One more question. Should i change the containerProps to be passed before the style prop? This way the containerProps can't overwrite the style prop.
Hi @Zeikko, I think it is okay. Usually, developers will not put style there. if they insist to put, they will see the change. And that will be okay.
Hi @tomzaku, As far as i have understood everything should be fine now. Are you able to merge and release soon? I'm looking forward to the new version. Thanks!
Merging now. Thank you
react-native-shimmer-placeholder 2.0.7 published 🎉
Hi @Zeikko ,Could you help me?
I am trying test childrenContainerProps
,shimmerContainerProps
,containerProps
these three prop, Could you upload some demo show how to use this three props ?
Add optional
testID
string prop.This enables the shimmer to be queried with react-native-testing-library using the testID. For example if we have a component which includes this JSX:
We can then wait for all the shimmers to disappear before testing the component contents:
This makes it easy to test that shims are rendered and removed in the correct place and time.