Skip to content

Commit

Permalink
fix(react): 手动导出以解决 cjs 下 Cannot redefine property 的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Aug 7, 2020
1 parent fc6a5da commit 11fb15c
Showing 1 changed file with 107 additions and 1 deletion.
108 changes: 107 additions & 1 deletion src/react/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,113 @@

/* istanbul ignore file */

export * from 'react-use'
export {
// 手动导出以解决 cjs 下 Cannot redefine property 的问题
// @index(['../../node_modules/react-use/esm/{use,create}*.js', '!**/{useToggle,createGlobalState,useTitle,useInterval,useSearchParam,useLocalStorage,useWindowSize,useHover,createRouter,useKeyboardJs,useMeasureDirty,useSpring,useWait}.js'], (f, _) => `${f.name},`)
createBreakpoint,
createMemo,
createReducer,
createReducerContext,
createStateContext,
useAsync,
useAsyncFn,
useAsyncRetry,
useAudio,
useBattery,
useBeforeUnload,
useBoolean,
useClickAway,
useCookie,
useCopyToClipboard,
useCounter,
useCss,
useCustomCompareEffect,
useDebounce,
useDeepCompareEffect,
useDefault,
useDrop,
useDropArea,
useEffectOnce,
useEnsuredForwardedRef,
useError,
useEvent,
useFavicon,
useFirstMountState,
useFullscreen,
useGeolocation,
useGetSet,
useGetSetState,
useHarmonicIntervalFn,
useHash,
useHoverDirty,
useIdle,
useIntersection,
useIsomorphicLayoutEffect,
useKey,
useKeyPress,
useKeyPressEvent,
useLatest,
useLifecycles,
useList,
useLocation,
useLockBodyScroll,
useLogger,
useLongPress,
useMap,
useMeasure,
useMedia,
useMediaDevices,
useMediatedState,
useMethods,
useMotion,
useMount,
useMountedState,
useMouse,
useMouseHovered,
useMultiStateValidator,
useNetwork,
useNumber,
useObservable,
useOrientation,
usePageLeave,
usePermission,
usePrevious,
usePreviousDistinct,
usePromise,
useQueue,
useRaf,
useRafLoop,
useRafState,
useRendersCount,
useScratch,
useScroll,
useScrollbarWidth,
useScrolling,
useSessionStorage,
useSet,
useSetState,
useShallowCompareEffect,
useSize,
useSlider,
useSpeech,
useStartTyping,
useStateList,
useStateValidator,
useStateWithHistory,
useThrottle,
useThrottleFn,
useTimeout,
useTimeoutFn,
useTween,
useUnmount,
useUnmountPromise,
useUpdate,
useUpdateEffect,
useUpsert,
useVibrate,
useVideo,
useWindowScroll, // @endindex
} from 'react-use'

// @index(['./**/*.ts', '!./**/*.{test,taro}.*', '!./{useToggle,createGlobalState,useTitle,useInterval,useSearchParam,useLocalStorage,useWindowSize,useHover}.*'], f => `export * from '${f.path}'`)
export * from './CommonComponentProps'
Expand Down

0 comments on commit 11fb15c

Please sign in to comment.