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

Allow passing a gradient component (breaking change) #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dan-lee
Copy link

@dan-lee dan-lee commented Jun 20, 2020

Hey @catalinmiron,

My goal with this PR is that one is able to pass any LinearGradient component to react-native-css-gradient.
This introduces a breaking change, as the default export is now is a creator function and no imports are done by this library itself:

import createCssGradient from "react-native-css-gradient";
import LinearGradient from "react-native-linear-gradient";
// or from expo:
// import { LinearGradient } from "expo-linear-gradient";

// create Gradient with gradient component.
const Gradient = createCssGradient(LinearGradient);

const App = () => (
  <Gradient
    // ...props
  />
);

I also took the freedom to make some minor tweaks:

  • Add and apply prettier for code formatting
  • Add types for typescript in index.d.ts
  • Restructure and add install notes to README

Please tell me your thoughts :)

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

Successfully merging this pull request may close these issues.

1 participant