Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/presets/react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,17 @@ export const CommonReactAPI = [
]

export default <ImportsMap>({
react: CommonReactAPI,
react: [
...CommonReactAPI,
'cache',
'cacheSignal',
'createContext',
'use',
'useOptimistic',
'useEffectEvent',
'useActionState',
'Fragment',
'Suspense',
'Activity',
],
})
10 changes: 10 additions & 0 deletions test/__snapshots__/dts.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ declare global {
const $ref: typeof import('vue/macros')['$ref']
const $shallowRef: typeof import('vue/macros')['$shallowRef']
const $toRef: typeof import('vue/macros')['$toRef']
const Activity: typeof import('react')['Activity']
const Bundle: typeof import('magic-string')['Bundle']
const EffectScope: typeof import('vue-demi')['EffectScope']
const Fragment: typeof import('react')['Fragment']
const SourceMap: typeof import('magic-string')['SourceMap']
const Suspense: typeof import('react')['Suspense']
const afterUpdate: typeof import('svelte')['afterUpdate']
const backIn: typeof import('svelte/easing')['backIn']
const backInOut: typeof import('svelte/easing')['backInOut']
Expand All @@ -28,11 +31,14 @@ declare global {
const bounceIn: typeof import('svelte/easing')['bounceIn']
const bounceInOut: typeof import('svelte/easing')['bounceInOut']
const bounceOut: typeof import('svelte/easing')['bounceOut']
const cache: typeof import('react')['cache']
const cacheSignal: typeof import('react')['cacheSignal']
const circIn: typeof import('svelte/easing')['circIn']
const circInOut: typeof import('svelte/easing')['circInOut']
const circOut: typeof import('svelte/easing')['circOut']
const computed: typeof import('vue-demi')['computed']
const createApp: typeof import('vue-demi')['createApp']
const createContext: typeof import('react')['createContext']
const createEventDispatcher: typeof import('svelte')['createEventDispatcher']
const createRef: typeof import('react')['createRef']
const crossfade: typeof import('svelte/transition')['crossfade']
Expand Down Expand Up @@ -124,18 +130,22 @@ declare global {
const triggerRef: typeof import('vue-demi')['triggerRef']
const tweened: typeof import('svelte/motion')['tweened']
const unref: typeof import('vue-demi')['unref']
const use: typeof import('react')['use']
const useActionState: typeof import('react')['useActionState']
const useAttrs: typeof import('vue-demi')['useAttrs']
const useCallback: typeof import('react')['useCallback']
const useContext: typeof import('react')['useContext']
const useCssModule: typeof import('vue-demi')['useCssModule']
const useDebugValue: typeof import('react')['useDebugValue']
const useDeferredValue: typeof import('react')['useDeferredValue']
const useEffect: typeof import('react')['useEffect']
const useEffectEvent: typeof import('react')['useEffectEvent']
const useId: typeof import('react')['useId']
const useImperativeHandle: typeof import('react')['useImperativeHandle']
const useInsertionEffect: typeof import('react')['useInsertionEffect']
const useLayoutEffect: typeof import('react')['useLayoutEffect']
const useMemo: typeof import('react')['useMemo']
const useOptimistic: typeof import('react')['useOptimistic']
const useReducer: typeof import('react')['useReducer']
const useRef: typeof import('react')['useRef']
const useSlots: typeof import('vue-demi')['useSlots']
Expand Down