forked from ant-design/ant-design
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(drawer): rewrite with hook from @hosseinmd (ant-design#29229)
* refactor: drawer to functional component and hooks * chore: clean code default value * perf: remove doesn't necessary useCallback * chore: useContext instead of Consumer * fix ref * Add Drawer displayName * fix tsc * fix tsc Co-authored-by: Hossein Mohammadi <[email protected]>
- Loading branch information
Showing
3 changed files
with
273 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as React from 'react'; | ||
import Drawer from '..'; | ||
|
||
describe('Drawer.typescript', () => { | ||
it('Drawer', () => { | ||
const onClose = jest.fn(); | ||
const wrapper = ( | ||
<Drawer | ||
title="Basic Drawer" | ||
placement="right" | ||
closable={false} | ||
onClose={onClose} | ||
visible={false} | ||
> | ||
<p>Some contents...</p> | ||
<p>Some contents...</p> | ||
<p>Some contents...</p> | ||
</Drawer> | ||
); | ||
|
||
expect(wrapper).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.