File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
apps/pyconkr/src/debug/page
packages/common/src/components Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,12 @@ const setMdxInputToLocalStorage: (input: string) => string = (input) => {
1919
2020export const MdiTestPage : React . FC = ( ) => {
2121 const inputRef = React . useRef < HTMLTextAreaElement > ( null ) ;
22- const [ state , setState ] = React . useState < { text : string , resetKey : string } > ( {
22+ const [ state , setState ] = React . useState < { text : string , resetKey : number } > ( {
2323 text : getMdxInputFromLocalStorage ( ) ,
24- resetKey : window . crypto . randomUUID ( )
24+ resetKey : Math . random ( )
2525 } ) ;
2626
27- const setMDXInput = ( text : string ) => setState ( { text : setMdxInputToLocalStorage ( text ) , resetKey : window . crypto . randomUUID ( ) } ) ;
27+ const setMDXInput = ( text : string ) => setState ( { text : setMdxInputToLocalStorage ( text ) , resetKey : Math . random ( ) } ) ;
2828
2929 return (
3030 < Stack direction = "row" spacing = { 2 } sx = { { width : "100%" , flexGrow : 1 , p : 2 } } >
Original file line number Diff line number Diff line change @@ -38,15 +38,15 @@ const lineFormatterForMDX = (line: string) => {
3838 return `${ trimmedLine } \n` ;
3939}
4040
41- export const MDXRenderer : React . FC < { text : string ; resetKey ?: string } > = ( { text, resetKey } ) => {
41+ export const MDXRenderer : React . FC < { text : string ; resetKey ?: number } > = ( { text, resetKey } ) => {
4242 const { baseUrl, mdxComponents } = Hooks . Common . useCommonContext ( ) ;
43- const [ state , setState ] = React . useState < { component : React . ReactNode , resetKey : string } > ( {
43+ const [ state , setState ] = React . useState < { component : React . ReactNode , resetKey : number } > ( {
4444 component : < CircularProgress /> ,
45- resetKey : window . crypto . randomUUID ( ) ,
45+ resetKey : Math . random ( ) ,
4646 } )
4747
4848 const setRenderResult = ( component : React . ReactNode ) => setState ( ( prev ) => ( { ...prev , component : component } ) ) ;
49- const setRandomResetKey = ( ) => setState ( ( prev ) => ( { ...prev , resetKey : window . crypto . randomUUID ( ) } ) )
49+ const setRandomResetKey = ( ) => setState ( ( prev ) => ( { ...prev , resetKey : Math . random ( ) } ) )
5050
5151 React . useEffect ( ( ) => {
5252 (
You can’t perform that action at this time.
0 commit comments