-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[enhancement] flexible export from root for props #234
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #234 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 5 5
Lines 107 107
Branches 31 31
=========================================
Hits 107 107 ☔ View full report in Codecov by Sentry. |
src/index.tsx
Outdated
@@ -1,3 +1,6 @@ | |||
export * from './Dropdown'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export * from './Dropdown'; | |
export type { TriggerProps, DropdownProps } from './Dropdown'; |
Do not use export *
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@afc163 sounds better, updated PR with this suggestion
src/index.tsx
Outdated
@@ -1,3 +1,6 @@ | |||
import Dropdown from './Dropdown' | |||
export type { DropdownProps, TriggerProps } from './Dropdown'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export type { DropdownProps, TriggerProps } from './Dropdown'; | |
export type { TriggerProps } from '@rc-component/trigger'; | |
export type { DropdownProps } from './Dropdown'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@afc163 got your point, updated the PR
c5af389
to
6927c17
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved feedback's
DropdownProps
Before
import { DropdownProps } from 'rc-dropdown/lib/Dropdown';
Now
import { DropdownProps } from 'rc-dropdown/lib/Dropdown';
import { DropdownProps } from 'rc-dropdown';
OverlayProps
Before
import { OverlayProps } from 'rc-dropdown/lib/Overlay';
Now
import { OverlayProps } from 'rc-dropdown/lib/Overlay';
import { OverlayProps } from 'rc-dropdown';
TriggerProps
Before
Not supported
Hack
install:
@rc-component/trigger
import { TriggerProps } from '@rc-component/trigger';
Now
import { TriggerProps } from 'rc-dropdown';
import { TriggerProps } from 'rc-dropdown/lib/Dropdown';
Why need TriggerProps ?
We pass all rest props to Trigger (@rc-component/trigger), for advance customization we required that support in
ts
so we can skip extra install @rc-component/trigger, with install externally it can lead issue because of version miss match.