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

Type-safe to as prop #3

Closed
danilowoz opened this issue May 13, 2020 · 2 comments · Fixed by #11
Closed

Type-safe to as prop #3

danilowoz opened this issue May 13, 2020 · 2 comments · Fixed by #11
Labels
help wanted Extra attention is needed released

Comments

@danilowoz
Copy link
Owner

Currently, when the as prop is used in a new component, the props from the new component are no type-safe. Example:

import styl from "react-native-styl"
import { Text, TouchableOpacity } from "react-native"

const Base = styl(Text)({
  padding: 16
})

// onPress is not typed correctly
<Base as={TouchableOpacity} onPress={() => null}>
  <Text>TouchableOpacity</Text>
</Base>

The goal here is when the component receives a component through as, the type needs to infer and get the props from the new component, and pass it to the render.

@danilowoz danilowoz added the help wanted Extra attention is needed label May 13, 2020
@danilowoz
Copy link
Owner Author

🎉 This issue has been resolved in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant