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

Make gradient component injectable #44

Closed
brentvatne opened this issue May 9, 2020 · 5 comments
Closed

Make gradient component injectable #44

brentvatne opened this issue May 9, 2020 · 5 comments

Comments

@brentvatne
Copy link

It would be useful to be able to provide the gradient component similar to how redux-persist asks you to pass in the storage API: https://github.com/rt2zz/redux-persist#v6-upgrade

@tomzaku
Copy link
Owner

tomzaku commented Jun 8, 2020

Good idea. Do you have any plans to create a PR for me?

@brentvatne
Copy link
Author

i'm not planning on it but it'd be cool to see :)

another thing that could be done to make this work out of the box in managed expo projects is to do something like this pr react-native-async-storage/async-storage#368 - use .expo.js extension to use expo-linear-gradient rather than react-native-linear-gradient when in expo managed apps

@tomzaku
Copy link
Owner

tomzaku commented Sep 1, 2020

Now we're using :

import { createShimmerPlaceholder } from 'react-native-shimmer-placeholder'

const ShimmerPlaceholder = createShimmerPlaceholder(LinearGradient)
...
<ShimmerPlaceholder />

or

import ShimmerPlaceholder from 'react-native-shimmer-placeholder'

<ShimmerPlaceholder
LinearGradient={LinearGradient}
/>

@tomzaku tomzaku closed this as completed Sep 1, 2020
@brentvatne
Copy link
Author

nice one!

@tomzaku
Copy link
Owner

tomzaku commented Sep 2, 2020

For expo user.
No longer imported LinearGradient. It will be added by default

For example

import ShimmerPlaceholder from 'react-native-shimmer-placeholder'
<ShimmerPlaceholder />

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