@@ -11,7 +11,7 @@ The `.attrs()` method lets you attach default props or computed props to styled
1111Set default props for your components:
1212
1313``` tsx
14- const Input = styled ( TextInput ) .attrs ({
14+ const Input = styled . TextInput .attrs ({
1515 placeholderTextColor: ' #999' ,
1616 autoCapitalize: ' none' ,
1717 autoCorrect: false ,
@@ -32,7 +32,7 @@ const Input = styled(TextInput).attrs({
3232Use a function to compute props dynamically:
3333
3434``` tsx
35- const Button = styled ( Pressable ) .attrs <{ $size? : ' small' | ' large' }>(
35+ const Button = styled . Pressable .attrs <{ $size? : ' small' | ' large' }>(
3636 (props ) => ({
3737 hitSlop: props .$size === ' small' ? 8 : 16 ,
3838 accessible: true ,
@@ -50,7 +50,7 @@ const Button = styled(Pressable).attrs<{ $size?: 'small' | 'large' }>(
5050Use attrs to set accessibility properties:
5151
5252``` tsx
53- const Card = styled ( View ) .attrs ({
53+ const Card = styled . View .attrs ({
5454 accessible: true ,
5555 accessibilityRole: ' button' as const ,
5656})`
@@ -59,7 +59,7 @@ const Card = styled(View).attrs({
5959 border-radius: 12px;
6060` ;
6161
62- const Heading = styled ( Text ) .attrs ({
62+ const Heading = styled . Text .attrs ({
6363 accessible: true ,
6464 accessibilityRole: ' header' as const ,
6565})`
@@ -73,7 +73,7 @@ const Heading = styled(Text).attrs({
7373Props passed to the component override attrs:
7474
7575``` tsx
76- const Input = styled ( TextInput ) .attrs ({
76+ const Input = styled . TextInput .attrs ({
7777 placeholderTextColor: ' #999' ,
7878})`
7979 padding: 12px;
@@ -93,7 +93,7 @@ const Input = styled(TextInput).attrs({
9393``` tsx
9494import { Platform } from ' react-native' ;
9595
96- const Input = styled ( TextInput ) .attrs ({
96+ const Input = styled . TextInput .attrs ({
9797 placeholderTextColor: ' #999' ,
9898 ... (Platform .OS === ' ios' ? {
9999 keyboardAppearance: ' dark' as const ,
@@ -109,7 +109,7 @@ const Input = styled(TextInput).attrs({
109109You can chain multiple ` .attrs() ` calls:
110110
111111``` tsx
112- const BaseButton = styled ( Pressable ) .attrs ({
112+ const BaseButton = styled . Pressable .attrs ({
113113 accessible: true ,
114114 accessibilityRole: ' button' as const ,
115115})`
0 commit comments