Browse Source

chore(Drawer): Improve warning message wording and demo doc (#39207)

* Improve warning message wording

* Improve wording in demo

* Fix test
pull/39220/head
Arnaud Benhamdine 2 years ago
committed by GitHub
parent
commit
33e06a2b92
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      components/drawer/__tests__/Drawer.test.tsx
  2. 2
      components/drawer/demo/render-in-current.md
  3. 2
      components/drawer/index.tsx

2
components/drawer/__tests__/Drawer.test.tsx

@ -237,7 +237,7 @@ describe('Drawer', () => {
render(<Drawer getContainer={false} style={{ position: 'absolute' }} />);
expect(errorSpy).toHaveBeenCalledWith(
'Warning: [antd: Drawer] `style` is move to `rootStyle` in v5. Please confirm `position: absolute` is necessary.',
'Warning: [antd: Drawer] `style` is replaced by `rootStyle` in v5. Please check that `position: absolute` is necessary.',
);
errorSpy.mockRestore();

2
components/drawer/demo/render-in-current.md

@ -8,7 +8,7 @@
Render in current dom. custom container, check `getContainer`.
Note: `style` and `className` is move to Drawer panel in v5 which is align with Modal component. Origin `style` and `className` is replaced by `rootStyle` and `rootClassName`.
Note: `style` and `className` props are moved to Drawer panel in v5 which is aligned with Modal component. Original `style` and `className` props are replaced by `rootStyle` and `rootClassName`.
```css
.site-drawer-render-in-current-wrapper {

2
components/drawer/index.tsx

@ -98,7 +98,7 @@ function Drawer(props: DrawerProps) {
warning(
false,
'Drawer',
'`style` is move to `rootStyle` in v5. Please confirm `position: absolute` is necessary.',
'`style` is replaced by `rootStyle` in v5. Please check that `position: absolute` is necessary.',
);
}
}

Loading…
Cancel
Save