File tree Expand file tree Collapse file tree 2 files changed +308
-36
lines changed
versioned_docs/version-7.x Expand file tree Collapse file tree 2 files changed +308
-36
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,21 @@ export default function Pre({
73
73
}
74
74
75
75
const dependencies = deps
76
- ? Object . fromEntries ( deps . split ( ',' ) . map ( ( entry ) => entry . split ( '@' ) ) )
76
+ ? Object . fromEntries (
77
+ deps . split ( ',' ) . map ( ( entry ) => {
78
+ let prefix = '' ;
79
+
80
+ // Handles scoped packages, e.g. @expo/vector-icons
81
+ if ( entry . startsWith ( '@' ) ) {
82
+ prefix = '@' ;
83
+ entry = entry . slice ( 1 ) ;
84
+ }
85
+
86
+ const [ name , version = '*' ] = entry . split ( '@' ) ;
87
+
88
+ return [ prefix + name , version ] ;
89
+ } )
90
+ )
77
91
: { } ;
78
92
79
93
Object . assign (
@@ -118,6 +132,11 @@ export default function Pre({
118
132
] . every ( ( comment ) => line . trim ( ) !== comment )
119
133
)
120
134
. join ( '\n' )
135
+ // Use expo/vector-icons instead of react-native-vector-icons for snack
136
+ . replace (
137
+ / i m p o r t ( .* ) f r o m ' r e a c t - n a t i v e - v e c t o r - i c o n s \/ ( .* ) ' / g,
138
+ 'import $1 from "@expo/vector-icons/$2"'
139
+ )
121
140
) ;
122
141
123
142
url . searchParams . set (
You can’t perform that action at this time.
0 commit comments