@@ -44,6 +44,8 @@ export class CreateProjectCommand implements ICommand {
44
44
selectedTemplate = constants . ANGULAR_NAME ;
45
45
} else if ( this . $options . vue ) {
46
46
selectedTemplate = constants . VUE_NAME ;
47
+ } else if ( this . $options . react ) {
48
+ selectedTemplate = constants . REACT_NAME ;
47
49
} else {
48
50
selectedTemplate = this . $options . template ;
49
51
}
@@ -82,6 +84,7 @@ export class CreateProjectCommand implements ICommand {
82
84
private async interactiveFlavorSelection ( adverb : string ) {
83
85
const flavorSelection = await this . $prompter . promptForDetailedChoice ( `${ adverb } , which style of NativeScript project would you like to use:` , [
84
86
{ key : constants . NgFlavorName , description : "Learn more at https://nativescript.org/angular" } ,
87
+ { key : constants . ReactFlavorName , description : "Learn more at https://github.com/shirakaba/react-nativescript" } ,
85
88
{ key : constants . VueFlavorName , description : "Learn more at https://nativescript.org/vue" } ,
86
89
{ key : constants . TsFlavorName , description : "Learn more at https://nativescript.org/typescript" } ,
87
90
{ key : constants . JsFlavorName , description : "Use NativeScript without any framework" } ,
@@ -96,8 +99,7 @@ export class CreateProjectCommand implements ICommand {
96
99
this . $logger . printMarkdown ( `# Let’s create a NativeScript app!` ) ;
97
100
this . $logger . printMarkdown ( `
98
101
Answer the following questions to help us build the right app for you. (Note: you
99
- can skip this prompt next time using the --template option, or the --ng, --vue, --ts,
100
- or --js flags.)
102
+ can skip this prompt next time using the --template option, or the --ng, --react, --vue, --ts, or --js flags.)
101
103
` ) ;
102
104
}
103
105
}
@@ -114,6 +116,10 @@ or --js flags.)
114
116
selectedFlavorTemplates . push ( ...this . getNgTemplates ( ) ) ;
115
117
break ;
116
118
}
119
+ case constants . ReactFlavorName : {
120
+ selectedFlavorTemplates . push ( ...this . getReactTemplates ( ) ) ;
121
+ break ;
122
+ }
117
123
case constants . VueFlavorName : {
118
124
selectedFlavorTemplates . push ( ...this . getVueTemplates ( ) ) ;
119
125
break ;
@@ -200,6 +206,16 @@ or --js flags.)
200
206
return templates ;
201
207
}
202
208
209
+ private getReactTemplates ( ) {
210
+ const templates = [ {
211
+ key : CreateProjectCommand . HelloWorldTemplateKey ,
212
+ value : constants . RESERVED_TEMPLATE_NAMES . react ,
213
+ description : CreateProjectCommand . HelloWorldTemplateDescription
214
+ } ] ;
215
+
216
+ return templates ;
217
+ }
218
+
203
219
private getVueTemplates ( ) {
204
220
const templates = [ {
205
221
key : CreateProjectCommand . BlankTemplateKey ,
0 commit comments