-
Notifications
You must be signed in to change notification settings - Fork 199
feat: 增加多个hooks和工具函数的导出 #656
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,6 +1,114 @@ | ||
| // Hooks exports | ||
| export { default as useEvent } from './hooks/useEvent'; | ||
| export { default as useEffect } from './hooks/useEffect'; | ||
| export { default as useId } from './hooks/useId'; | ||
| export { resetUuid } from './hooks/useId'; | ||
| export { default as useLayoutEffect } from './hooks/useLayoutEffect'; | ||
| export { useLayoutUpdateEffect } from './hooks/useLayoutEffect'; | ||
| export { default as useMemo } from './hooks/useMemo'; | ||
| export { default as useMergedState } from './hooks/useMergedState'; | ||
| export { supportNodeRef, supportRef, useComposeRef } from './ref'; | ||
| export { default as useMobile } from './hooks/useMobile'; | ||
| export { default as useState } from './hooks/useState'; | ||
| export { default as useSyncState } from './hooks/useSyncState'; | ||
|
|
||
| // Hook types | ||
| export type { SetState } from './hooks/useState'; | ||
| export type { SetState as SyncSetState } from './hooks/useSyncState'; | ||
|
|
||
| // Ref utilities | ||
| export { | ||
| supportNodeRef, | ||
| supportRef, | ||
| useComposeRef, | ||
| fillRef, | ||
| composeRef, | ||
| getNodeRef, | ||
| } from './ref'; | ||
|
|
||
| // Utility functions | ||
| export { default as get } from './utils/get'; | ||
| export { default as set } from './utils/set'; | ||
| export { merge } from './utils/set'; | ||
| export { default as warning } from './warning'; | ||
| export { default as omit } from './omit'; | ||
| export { default as KeyCode } from './KeyCode'; | ||
| export { default as isEqual } from './isEqual'; | ||
| export { default as isMobile } from './isMobile'; | ||
| export { default as raf } from './raf'; | ||
| export { default as proxyObject } from './proxyObject'; | ||
| export { default as setStyle } from './setStyle'; | ||
| export { default as pickAttrs } from './pickAttrs'; | ||
| export { default as composeProps } from './composeProps'; | ||
|
|
||
| // Warning utilities | ||
| export { | ||
| preMessage, | ||
| warning as warningFunc, | ||
| note, | ||
| resetWarned, | ||
| call, | ||
| warningOnce, | ||
| noteOnce, | ||
| } from './warning'; | ||
| export type { preMessageFn } from './warning'; | ||
|
|
||
| // Set utilities types | ||
| export type { Path } from './utils/set'; | ||
|
|
||
| // SetStyle types | ||
| export type { SetStyleOptions } from './setStyle'; | ||
|
|
||
| // PickAttrs types | ||
| export type { PickConfig } from './pickAttrs'; | ||
|
|
||
| // Children utilities | ||
| export { default as toArray } from './Children/toArray'; | ||
| export type { Option as ToArrayOption } from './Children/toArray'; | ||
|
|
||
| // DOM utilities | ||
| export { default as canUseDom } from './Dom/canUseDom'; | ||
| export { default as contains } from './Dom/contains'; | ||
| export { | ||
| injectCSS, | ||
| removeCSS, | ||
| clearContainerCache, | ||
| updateCSS, | ||
| } from './Dom/dynamicCSS'; | ||
| export { default as findDOMNode, isDOM, getDOM } from './Dom/findDOMNode'; | ||
| export { | ||
| getFocusNodeList, | ||
| saveLastFocusNode, | ||
| clearLastFocusNode, | ||
| backLastFocusNode, | ||
| limitTabRange, | ||
| } from './Dom/focus'; | ||
| export { default as isVisible } from './Dom/isVisible'; | ||
| export { default as ScrollLocker } from './Dom/scrollLocker'; | ||
| export { inShadow, getShadowRoot } from './Dom/shadow'; | ||
| export { isStyleSupport } from './Dom/styleChecker'; | ||
|
|
||
| // DOM types | ||
| export type { ContainerType, Prepend, AppendType } from './Dom/dynamicCSS'; | ||
| export type { scrollLockOptions } from './Dom/scrollLocker'; | ||
|
|
||
| // React utilities | ||
| export { default as isFragment } from './React/isFragment'; | ||
| export { render, unmount } from './React/render'; | ||
|
|
||
| // Portal components | ||
| export { default as Portal } from './Portal'; | ||
| export { default as PortalWrapper, getOpenCount } from './PortalWrapper'; | ||
|
|
||
| // Portal types | ||
| export type { PortalRef, PortalProps } from './Portal'; | ||
| export type { GetContainer, PortalWrapperProps } from './PortalWrapper'; | ||
|
|
||
| // Scroll utilities | ||
| export { | ||
| default as getScrollBarSize, | ||
| getTargetScrollBarSize, | ||
| } from './getScrollBarSize'; | ||
|
|
||
| // Test utilities | ||
| export { spyElementPrototypes, spyElementPrototype } from './test/domHook'; | ||
| export type { ElementClass, Property } from './test/domHook'; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
选一部分吧,有的 OOD 了想淘汰的