@@ -18,14 +18,14 @@ declare interface ContainerProps {
1818
1919const Full :ContainerComponent < ContainerProps , any > = forwardRef ( ( props , ref ) => {
2020 return (
21- < div ref = { ref } id = "html-root" className = "col uds-full-width" { ...props } />
21+ < div ref = { ref } className = "col uds-full-width" { ...props } />
2222) } ) ;
2323
2424const UdsContainer :ContainerComponent < ContainerProps , any > = forwardRef ( ( props , ref ) => {
2525 return (
2626 < div className = "container" >
2727 < div className = "row" >
28- < div ref = { ref } id = "html-root" className = "uds-container" { ...props } />
28+ < div ref = { ref } className = "uds-container" { ...props } />
2929 </ div >
3030 </ div >
3131) } ) ;
@@ -34,21 +34,22 @@ export const withContainer: Decorator = (
3434 StoryFn ,
3535 {
3636 args,
37- globals : { framework = "react" } ,
37+ globals,
3838 parameters : { layout = "fullscreen" } ,
39+ viewMode,
3940 }
4041) => {
42+ let { framework = "react" } = globals ;
43+ // Doc page will only render react framework
44+ if ( viewMode === "docs" ) {
45+ framework = "react" ;
46+ }
4147 const isBootstrap = framework === "bootstrap" ;
42- const isReact = ! isBootstrap ;
4348 const root = React . useRef ( null as any ) ;
4449
4550 const emit = useChannel ( { "HTML/CodeUpdated" : ( ) => { } } ) ;
4651
47-
48-
4952 const mount = ( ) => {
50- // console.log("sb mounting");
51-
5253 if ( root . current ) {
5354 if ( isBootstrap ) {
5455 // custom events created by eventSpy.js to allow storybook to dispatch load events after the page is loaded
@@ -58,7 +59,6 @@ export const withContainer: Decorator = (
5859
5960 emit ( "HTML/CodeUpdated" , { code : root . current . innerHTML } ) ;
6061 }
61-
6262 }
6363
6464 const unmount = ( ) => {
@@ -77,19 +77,10 @@ export const withContainer: Decorator = (
7777 }
7878 }
7979
80-
81-
82-
83-
84-
85-
86-
8780 useEffect ( ( ) => {
8881 // @ts -ignore
8982 if ( ! window . unloading ) {
9083 mount ( )
91- } else {
92-
9384 }
9485 return unmount
9586 } , [ StoryFn , args , framework ] ) ;
@@ -116,5 +107,3 @@ export const withContainer: Decorator = (
116107export const globalDecorators = [
117108 withContainer
118109] ;
119-
120-
0 commit comments