File tree Expand file tree Collapse file tree
docs/data/joy/components/modal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,14 +8,17 @@ import DialogContent from '@mui/joy/DialogContent';
88
99export default function FadeModalDialog ( ) {
1010 const [ open , setOpen ] = React . useState ( false ) ;
11+ const nodeRef = React . useRef ( null ) ;
12+
1113 return (
1214 < React . Fragment >
1315 < Button variant = "outlined" color = "neutral" onClick = { ( ) => setOpen ( true ) } >
1416 Open modal
1517 </ Button >
16- < Transition in = { open } timeout = { 400 } >
18+ < Transition nodeRef = { nodeRef } in = { open } timeout = { 400 } >
1719 { ( state ) => (
1820 < Modal
21+ ref = { nodeRef }
1922 keepMounted
2023 open = { ! [ 'exited' , 'exiting' ] . includes ( state ) }
2124 onClose = { ( ) => setOpen ( false ) }
Original file line number Diff line number Diff line change @@ -8,14 +8,17 @@ import DialogContent from '@mui/joy/DialogContent';
88
99export default function FadeModalDialog ( ) {
1010 const [ open , setOpen ] = React . useState < boolean > ( false ) ;
11+ const nodeRef = React . useRef ( null ) ;
12+
1113 return (
1214 < React . Fragment >
1315 < Button variant = "outlined" color = "neutral" onClick = { ( ) => setOpen ( true ) } >
1416 Open modal
1517 </ Button >
16- < Transition in = { open } timeout = { 400 } >
18+ < Transition nodeRef = { nodeRef } in = { open } timeout = { 400 } >
1719 { ( state : string ) => (
1820 < Modal
21+ ref = { nodeRef }
1922 keepMounted
2023 open = { ! [ 'exited' , 'exiting' ] . includes ( state ) }
2124 onClose = { ( ) => setOpen ( false ) }
You can’t perform that action at this time.
0 commit comments