File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/docusaurus-theme-openapi-docs/src/theme/ApiDemoPanel/LiveEditor Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 55 * LICENSE file in the root directory of this source tree.
66 * ========================================================================== */
77
8- import React , { useState } from "react" ;
8+ import React , { useEffect , useState } from "react" ;
99
1010import { usePrismTheme } from "@docusaurus/theme-common" ;
1111import useIsBrowser from "@docusaurus/useIsBrowser" ;
@@ -51,7 +51,11 @@ function App({
5151} : any ) : JSX . Element {
5252 const prismTheme = usePrismTheme ( ) ;
5353 const [ code , setCode ] = React . useState ( children ) ;
54- action ( setStringRawBody ( code ) ) ;
54+
55+ useEffect ( ( ) => {
56+ action ( setStringRawBody ( code ) ) ;
57+ } , [ action , code ] ) ;
58+
5559 return (
5660 < div className = { styles . playgroundContainer } >
5761 < LiveProvider
You can’t perform that action at this time.
0 commit comments