Type-safe to `as` prop
danilowoz opened this issue ยท 2 comments
danilowoz commented
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 commented
danilowoz commented
๐ This issue has been resolved in version 1.2.0 ๐
The release is available on:
Your semantic-release bot ๐ฆ๐