File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
packages/common/src/templates Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 1- import immer from 'immer' ;
2-
31import { absolute } from '../utils/path' ;
42import {
53 ConfigurationFile ,
@@ -68,6 +66,10 @@ const CLIENT_VIEWS: ViewConfig[] = [
6866 } ,
6967] ;
7068
69+ // React sandboxes have an additional devtool on top of CLIENT_VIEWS
70+ const REACT_CLIENT_VIEWS : ViewConfig [ ] = [ ...CLIENT_VIEWS ] ;
71+ REACT_CLIENT_VIEWS [ 1 ] . views . push ( { id : 'codesandbox.react-devtools' } ) ;
72+
7173const SERVER_VIEWS : ViewConfig [ ] = [
7274 {
7375 views : [ { id : 'codesandbox.browser' } ] ,
@@ -204,10 +206,9 @@ export default class Template {
204206 configurationFiles . package &&
205207 configurationFiles . package . parsed &&
206208 configurationFiles . package . parsed . dependencies ;
209+
207210 if ( dependencies && dependencies . react ) {
208- return immer ( CLIENT_VIEWS , draft => {
209- draft [ 1 ] . views . push ( { id : 'codesandbox.react-devtools' } ) ;
210- } ) ;
211+ return REACT_CLIENT_VIEWS ;
211212 }
212213
213214 return CLIENT_VIEWS ;
You can’t perform that action at this time.
0 commit comments