File tree Expand file tree Collapse file tree
versioned_docs/version-7.x Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,7 +73,21 @@ export default function Pre({
7373 }
7474
7575 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+ )
7791 : { } ;
7892
7993 Object . assign (
@@ -118,6 +132,11 @@ export default function Pre({
118132 ] . every ( ( comment ) => line . trim ( ) !== comment )
119133 )
120134 . 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+ )
121140 ) ;
122141
123142 url . searchParams . set (
You can’t perform that action at this time.
0 commit comments