@suspensive/react-dom
Advanced tools
Comparing version 0.1.5 to 0.2.0
export { InView } from './InView.js'; | ||
export { useInView } from './useInView.js'; | ||
export { FadeIn } from './FadeIn.js'; | ||
export { useFadeIn } from './useFadeIn.js'; | ||
import 'react/jsx-runtime'; | ||
import 'react'; |
"use client" | ||
import { | ||
FadeIn | ||
} from "./chunk-I4PASIB7.js"; | ||
import { | ||
InView | ||
} from "./chunk-WXC47UUD.js"; | ||
import { | ||
useFadeIn | ||
} from "./chunk-MW4QZYFN.js"; | ||
import { | ||
useInView | ||
} from "./chunk-GJKK7GK5.js"; | ||
export { | ||
FadeIn, | ||
InView, | ||
useFadeIn, | ||
useInView | ||
}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@suspensive/react-dom", | ||
"version": "0.1.5", | ||
"version": "0.2.0", | ||
"description": "Suspensive interfaces for react-dom", | ||
@@ -42,4 +42,4 @@ "keywords": [ | ||
"devDependencies": { | ||
"@types/react": "^18.3.10", | ||
"@types/react-dom": "^18.3.0", | ||
"@types/react": "^18.3.12", | ||
"@types/react-dom": "^18.3.1", | ||
"react": "^18.3.1", | ||
@@ -60,3 +60,3 @@ "react-dom": "^18.3.1", | ||
"ci:attw": "attw --pack", | ||
"ci:eslint": "eslint \"**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts}\"", | ||
"ci:eslint": "eslint \"**/*.{ts,tsx,cts,mts}\"", | ||
"ci:publint": "publint --strict", | ||
@@ -63,0 +63,0 @@ "ci:test": "vitest run --coverage --typecheck", |
export { InView } from './InView' | ||
export { useInView } from './useInView' | ||
export { FadeIn } from './FadeIn' | ||
export { useFadeIn } from './useFadeIn' |
@@ -1,3 +0,2 @@ | ||
import * as React from 'react' | ||
import * as DeprecatedReactTestUtils from 'react-dom/test-utils' | ||
import { act } from 'react' | ||
@@ -11,4 +10,2 @@ declare global { | ||
const act = typeof React.act === 'function' ? React.act : DeprecatedReactTestUtils.act | ||
type Item = { | ||
@@ -15,0 +12,0 @@ callback: IntersectionObserverCallback |
import { intersectionMockInstance, mockIsIntersecting } from '../test-utils' | ||
import { observe, optionsToId } from './observe' | ||
test('should be able to use observe', () => { | ||
it('should be able to use observe', () => { | ||
const element = document.createElement('div') | ||
@@ -19,3 +19,18 @@ const cb = vi.fn() | ||
test('should convert options to id', () => { | ||
it('should be able to use observe without options', () => { | ||
const element = document.createElement('div') | ||
const cb = vi.fn() | ||
const unmount = observe(element, cb) | ||
mockIsIntersecting(element, true) | ||
expect(cb).toHaveBeenCalled() | ||
// should be unmounted after unmount | ||
unmount() | ||
expect(() => intersectionMockInstance(element)).toThrowErrorMatchingInlineSnapshot( | ||
`[Error: Failed to find IntersectionObserver for element. Is it being observed?]` | ||
) | ||
}) | ||
it('should convert options to id', () => { | ||
expect( | ||
@@ -22,0 +37,0 @@ optionsToId({ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
156084
56
2351