File tree 1 file changed +10
-2
lines changed 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -339,6 +339,9 @@ class CopyLink extends Component {
339
339
class Playground extends Component {
340
340
constructor ( props ) {
341
341
super ( props ) ;
342
+
343
+ // set default theme
344
+ const theme = "default" ;
342
345
// initialize state with Simple data sample
343
346
const { schema, uiSchema, formData, validate } = samples . Simple ;
344
347
this . state = {
@@ -347,7 +350,7 @@ class Playground extends Component {
347
350
uiSchema,
348
351
formData,
349
352
validate,
350
- theme : "default" ,
353
+ theme,
351
354
subtheme : null ,
352
355
liveSettings : {
353
356
validate : true ,
@@ -361,6 +364,8 @@ class Playground extends Component {
361
364
}
362
365
363
366
componentDidMount ( ) {
367
+ const { themes } = this . props ;
368
+ const { theme } = this . state ;
364
369
const hash = document . location . hash . match ( / # ( .* ) / ) ;
365
370
if ( hash && typeof hash [ 1 ] === "string" && hash [ 1 ] . length > 0 ) {
366
371
try {
@@ -369,7 +374,10 @@ class Playground extends Component {
369
374
alert ( "Unable to load form setup data." ) ;
370
375
}
371
376
} else {
372
- this . load ( { theme : Object . keys ( this . props . themes ) [ 0 ] } ) ;
377
+ // initialize theme
378
+ this . onThemeSelected ( theme , themes [ theme ] ) ;
379
+
380
+ this . setState ( { form : true } ) ;
373
381
}
374
382
}
375
383
You can’t perform that action at this time.
0 commit comments