@@ -74,6 +74,7 @@ export interface DrawerPopupProps
7474
7575 // styles
7676 styles ?: DrawerStyles ;
77+ drawerRender ?: ( node : React . ReactNode ) => React . ReactNode ;
7778}
7879
7980function DrawerPopup ( props : DrawerPopupProps , ref : React . Ref < HTMLDivElement > ) {
@@ -121,6 +122,7 @@ function DrawerPopup(props: DrawerPopupProps, ref: React.Ref<HTMLDivElement>) {
121122 onKeyUp,
122123
123124 styles,
125+ drawerRender,
124126 } = props ;
125127
126128 // ================================ Refs ================================
@@ -291,6 +293,22 @@ function DrawerPopup(props: DrawerPopupProps, ref: React.Ref<HTMLDivElement>) {
291293 leavedClassName = { `${ prefixCls } -content-wrapper-hidden` }
292294 >
293295 { ( { className : motionClassName , style : motionStyle } , motionRef ) => {
296+ const content = (
297+ < DrawerPanel
298+ id = { id }
299+ containerRef = { motionRef }
300+ prefixCls = { prefixCls }
301+ className = { classNames ( className , drawerClassNames ?. content ) }
302+ style = { {
303+ ...style ,
304+ ...styles ?. content ,
305+ } }
306+ { ...pickAttrs ( props , { aria : true } ) }
307+ { ...eventHandlers }
308+ >
309+ { children }
310+ </ DrawerPanel >
311+ ) ;
294312 return (
295313 < div
296314 className = { classNames (
@@ -305,20 +323,7 @@ function DrawerPopup(props: DrawerPopupProps, ref: React.Ref<HTMLDivElement>) {
305323 } }
306324 { ...pickAttrs ( props , { data : true } ) }
307325 >
308- < DrawerPanel
309- id = { id }
310- containerRef = { motionRef }
311- prefixCls = { prefixCls }
312- className = { classNames ( className , drawerClassNames ?. content ) }
313- style = { {
314- ...style ,
315- ...styles ?. content ,
316- } }
317- { ...pickAttrs ( props , { aria : true } ) }
318- { ...eventHandlers }
319- >
320- { children }
321- </ DrawerPanel >
326+ { drawerRender ? drawerRender ( content ) : content }
322327 </ div >
323328 ) ;
324329 } }
0 commit comments