Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

How to pass props to an imported component in styled-components

$
0
0

a challenge has arisen here, I'm using React Native and I need to pass props to RectButton, does anyone know how?

Because it is not a standard React Native feature, it is imported from react-native-gesture-handler, so I don't have access to it through styled-components, I would like something 'like this':

export const CheckBoxInput = styled(RectButton)<CheckBoxInputProps>`  border: 1px solid ${h4_app_color};  width: 20px;  height: 20px;  border-radius: 20px;  ${(props) =>    props.filled      ? css`          background-color: ${h4_app_color};        `      : css`          background-color: white;        `}`;

My props are like this:

interface CheckBoxInputProps {  filled?: boolean;}

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>