@@ -127,32 +127,6 @@ const Drawer: React.FC<DrawerProps> & {
127127 ? ( ) => getPopupContainer ( document . body )
128128 : customizeGetContainer ;
129129
130- // ========================== Warning ===========================
131- if ( process . env . NODE_ENV !== 'production' ) {
132- const warning = devUseWarning ( 'Drawer' ) ;
133- [
134- [ 'headerStyle' , 'styles.header' ] ,
135- [ 'bodyStyle' , 'styles.body' ] ,
136- [ 'footerStyle' , 'styles.footer' ] ,
137- [ 'contentWrapperStyle' , 'styles.wrapper' ] ,
138- [ 'maskStyle' , 'styles.mask' ] ,
139- [ 'drawerStyle' , 'styles.section' ] ,
140- [ 'destroyInactivePanel' , 'destroyOnHidden' ] ,
141- [ 'width' , 'size' ] ,
142- [ 'height' , 'size' ] ,
143- ] . forEach ( ( [ deprecatedName , newName ] ) => {
144- warning . deprecated ( ! ( deprecatedName in props ) , deprecatedName , newName ) ;
145- } ) ;
146-
147- if ( getContainer !== undefined && props . style ?. position === 'absolute' ) {
148- warning (
149- false ,
150- 'breaking' ,
151- '`style` is replaced by `rootStyle` in v5. Please check that `position: absolute` is necessary.' ,
152- ) ;
153- }
154- }
155-
156130 // ============================ Size ============================
157131 const drawerSize = React . useMemo < string | number | undefined > ( ( ) => {
158132 if ( typeof size === 'number' ) {
@@ -231,6 +205,38 @@ const Drawer: React.FC<DrawerProps> & {
231205 props : mergedProps ,
232206 } ) ;
233207
208+ // ========================== Warning ===========================
209+ if ( process . env . NODE_ENV !== 'production' ) {
210+ const warning = devUseWarning ( 'Drawer' ) ;
211+ [
212+ [ 'headerStyle' , 'styles.header' ] ,
213+ [ 'bodyStyle' , 'styles.body' ] ,
214+ [ 'footerStyle' , 'styles.footer' ] ,
215+ [ 'contentWrapperStyle' , 'styles.wrapper' ] ,
216+ [ 'maskStyle' , 'styles.mask' ] ,
217+ [ 'drawerStyle' , 'styles.section' ] ,
218+ [ 'destroyInactivePanel' , 'destroyOnHidden' ] ,
219+ [ 'width' , 'size' ] ,
220+ [ 'height' , 'size' ] ,
221+ ] . forEach ( ( [ deprecatedName , newName ] ) => {
222+ warning . deprecated ( ! ( deprecatedName in props ) , deprecatedName , newName ) ;
223+ } ) ;
224+
225+ if ( getContainer !== undefined && props . style ?. position === 'absolute' ) {
226+ warning (
227+ false ,
228+ 'breaking' ,
229+ '`style` is replaced by `rootStyle` in v5. Please check that `position: absolute` is necessary.' ,
230+ ) ;
231+ }
232+
233+ warning . deprecated (
234+ ! ( mergedClassNames ?. content || mergedStyles ?. content ) ,
235+ 'classNames.content and styles.content' ,
236+ 'classNames.section and styles.section' ,
237+ ) ;
238+ }
239+
234240 const drawerClassName = clsx (
235241 {
236242 'no-mask' : ! mergedMask ,
0 commit comments