@@ -52,14 +52,19 @@ const updateJsonPropName = (path, name) => {
5252 } ) ;
5353} ;
5454
55- const bumpReact = ( appPath , versionTag ) => {
55+ const bumpReact = ( appPath , versionTag , isTypeScript ) => {
5656 const dependencies = [
5757 { name : 'react' , version : versionTag } ,
5858 { name : 'react-dom' , version : versionTag } ,
59- { name : '@types/react' , version : versionTag , dev : true } ,
60- { name : '@types/react-dom' , version : versionTag , dev : true } ,
6159 ] ;
6260
61+ if ( isTypeScript ) {
62+ dependencies . push (
63+ { name : '@types/react' , version : versionTag , dev : true } ,
64+ { name : '@types/react-dom' , version : versionTag , dev : true } ,
65+ ) ;
66+ }
67+
6368 packageJsonUtils . addDependencies ( appPath , dependencies ) ;
6469} ;
6570
@@ -86,7 +91,7 @@ const create = async(appName, options) => {
8691 modifyIndexHtml ( appPath , templateOptions . project ) ;
8792
8893 if ( depsVersionTag ) {
89- bumpReact ( appPath , depsVersionTag ) ;
94+ bumpReact ( appPath , depsVersionTag , templateOptions . isTypeScript ) ;
9095 }
9196
9297 addTemplate ( appPath , appName , templateOptions ) ;
0 commit comments