Skip to content

Commit

Permalink
feat(*): support react 19
Browse files Browse the repository at this point in the history
  • Loading branch information
manudeli committed Dec 11, 2024
1 parent 7af2803 commit 794b8db
Show file tree
Hide file tree
Showing 16 changed files with 555 additions and 262 deletions.
4 changes: 2 additions & 2 deletions docs/suspensive.org/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"nextra": "^3.2.4",
"nextra-theme-docs": "^3.2.4",
"react": "catalog:react18",
"react-dom": "catalog:react-dom",
"react-dom": "catalog:react18",
"remark-sandpack": "^0.0.5",
"sharp": "catalog:",
"zod": "^3.23.8"
Expand All @@ -43,7 +43,7 @@
"@suspensive/eslint-config": "workspace:*",
"@types/d3": "^7.4.3",
"@types/react": "catalog:react18",
"@types/react-dom": "catalog:react-dom",
"@types/react-dom": "catalog:react18",
"autoprefixer": "catalog:",
"postcss": "catalog:",
"prettier-plugin-tailwindcss": "catalog:",
Expand Down
4 changes: 2 additions & 2 deletions examples/next-streaming-react-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
"@tanstack/react-query-next-experimental": "catalog:react-query5",
"next": "catalog:",
"react": "catalog:react18",
"react-dom": "catalog:react-dom",
"react-dom": "catalog:react18",
"sharp": "catalog:"
},
"devDependencies": {
"@suspensive/eslint-config": "workspace:*",
"@types/react": "catalog:react18",
"@types/react-dom": "catalog:react-dom",
"@types/react-dom": "catalog:react18",
"autoprefixer": "catalog:",
"postcss": "catalog:",
"prettier-plugin-tailwindcss": "catalog:",
Expand Down
48 changes: 24 additions & 24 deletions examples/react-native-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,39 @@
"web": "expo start --web"
},
"dependencies": {
"@expo/vector-icons": "catalog:react-native",
"@react-navigation/bottom-tabs": "catalog:react-native",
"@react-navigation/native": "catalog:react-native",
"@expo/vector-icons": "catalog:react18",
"@react-navigation/bottom-tabs": "catalog:react18",
"@react-navigation/native": "catalog:react18",
"@suspensive/react-native": "workspace:*",
"expo": "catalog:react-native",
"expo-blur": "catalog:react-native",
"expo-constants": "catalog:react-native",
"expo-font": "catalog:react-native",
"expo-haptics": "catalog:react-native",
"expo-linking": "catalog:react-native",
"expo-router": "catalog:react-native",
"expo-splash-screen": "catalog:react-native",
"expo-status-bar": "catalog:react-native",
"expo-symbols": "catalog:react-native",
"expo-system-ui": "catalog:react-native",
"expo-web-browser": "catalog:react-native",
"expo": "catalog:react18",
"expo-blur": "catalog:react18",
"expo-constants": "catalog:react18",
"expo-font": "catalog:react18",
"expo-haptics": "catalog:react18",
"expo-linking": "catalog:react18",
"expo-router": "catalog:react18",
"expo-splash-screen": "catalog:react18",
"expo-status-bar": "catalog:react18",
"expo-symbols": "catalog:react18",
"expo-system-ui": "catalog:react18",
"expo-web-browser": "catalog:react18",
"react": "catalog:react18",
"react-dom": "catalog:react-dom",
"react-native": "catalog:react-native",
"react-native-gesture-handler": "catalog:react-native",
"react-native-reanimated": "catalog:react-native",
"react-native-safe-area-context": "catalog:react-native",
"react-native-screens": "catalog:react-native",
"react-native-web": "catalog:react-native",
"react-native-webview": "catalog:react-native"
"react-dom": "catalog:react18",
"react-native": "catalog:react18",
"react-native-gesture-handler": "catalog:react18",
"react-native-reanimated": "catalog:react18",
"react-native-safe-area-context": "catalog:react18",
"react-native-screens": "catalog:react18",
"react-native-web": "catalog:react18",
"react-native-webview": "catalog:react18"
},
"devDependencies": {
"@babel/core": "^7.26.0",
"@types/jest": "^29.5.12",
"@types/react": "catalog:react18",
"@types/react-test-renderer": "^18.3.0",
"jest": "catalog:",
"jest-expo": "catalog:react-native",
"jest-expo": "catalog:react18",
"react-test-renderer": "18.3.1",
"typescript": "^5.7.2"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/visualization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
"clsx": "catalog:",
"next": "catalog:",
"react": "catalog:react18",
"react-dom": "catalog:react-dom",
"react-dom": "catalog:react18",
"sharp": "catalog:",
"zod": "^3.23.8"
},
"devDependencies": {
"@suspensive/eslint-config": "workspace:*",
"@suspensive/tsconfig": "workspace:*",
"@types/react": "catalog:react18",
"@types/react-dom": "catalog:react-dom",
"@types/react-dom": "catalog:react18",
"autoprefixer": "catalog:",
"postcss": "catalog:",
"prettier-plugin-tailwindcss": "catalog:",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"@tanstack/react-query": "catalog:react-query5",
"@tanstack/react-query-devtools": "catalog:react-query5",
"react": "catalog:react18",
"react-dom": "catalog:react-dom"
"react-dom": "catalog:react18"
},
"devDependencies": {
"@suspensive/eslint-config": "workspace:*",
"@suspensive/tsconfig": "workspace:*",
"@types/react": "catalog:react18",
"@types/react-dom": "catalog:react-dom",
"@types/react-dom": "catalog:react18",
"@vitejs/plugin-react": "^4.3.2",
"globals": "^15.10.0"
}
Expand Down
6 changes: 3 additions & 3 deletions packages/jotai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@
"@suspensive/eslint-config": "workspace:*",
"@suspensive/tsconfig": "workspace:*",
"@suspensive/tsup": "workspace:*",
"@types/react": "catalog:react18",
"@types/react": "catalog:react19",
"jotai": "^2.8.4",
"react": "catalog:react18"
"react": "catalog:react19"
},
"peerDependencies": {
"jotai": "^2",
"react": "^18"
"react": "^18 || ^19"
},
"publishConfig": {
"access": "public"
Expand Down
11 changes: 6 additions & 5 deletions packages/react-dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@
"@suspensive/eslint-config": "workspace:*",
"@suspensive/tsconfig": "workspace:*",
"@suspensive/tsup": "workspace:*",
"@types/react": "catalog:react18",
"@types/react-dom": "catalog:react-dom",
"react": "catalog:react18",
"react-dom": "catalog:react-dom"
"@types/react": "catalog:react19",
"@types/react-dom": "catalog:react19",
"react": "catalog:react19",
"react-dom": "catalog:react19"
},
"peerDependencies": {
"react": "^18"
"react": "^18 || ^19",
"react-dom": "^18 || ^19"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/useInView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function useInView({
entry?: IntersectionObserverEntry
} {
const [ref, setRef] = useState<Element | null>(null)
const onChangeRef = useRef<InViewOptions['onChange']>()
const onChangeRef = useRef<InViewOptions['onChange']>(null)
const [state, setState] = useState<{ inView: boolean; entry?: IntersectionObserverEntry }>({
inView: initialInView ?? false,
entry: undefined,
Expand Down Expand Up @@ -65,7 +65,7 @@ export function useInView({
delay,
])
const entryTarget = state.entry?.target
const previousEntryTarget = useRef<Element>()
const previousEntryTarget = useRef<Element>(null)
if (!ref && entryTarget && !triggerOnce && !skip && previousEntryTarget.current !== entryTarget) {
previousEntryTarget.current = entryTarget
setState({ inView: initialInView ?? false, entry: undefined })
Expand Down
14 changes: 7 additions & 7 deletions packages/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@
"@suspensive/eslint-config": "workspace:*",
"@suspensive/tsconfig": "workspace:*",
"@suspensive/tsup": "workspace:*",
"@testing-library/react-native": "catalog:react-native",
"@types/react": "catalog:react18",
"@testing-library/react-native": "catalog:react19",
"@types/react": "catalog:react19",
"babel-jest": "catalog:",
"expo": "catalog:react-native",
"expo": "catalog:react19",
"jest": "catalog:",
"jest-expo": "catalog:react-native",
"react": "catalog:react18",
"react-native": "catalog:react-native",
"jest-expo": "catalog:react19",
"react": "catalog:react19",
"react-native": "catalog:react19",
"ts-node": "^10.9.2"
},
"peerDependencies": {
"react": "^18",
"react": "^18 || ^19",
"react-native": "^0.76.1"
},
"publishConfig": {
Expand Down
6 changes: 3 additions & 3 deletions packages/react-query-4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
"@suspensive/tsconfig": "workspace:*",
"@suspensive/tsup": "workspace:*",
"@tanstack/react-query": "catalog:react-query4",
"@types/react": "catalog:react18",
"react": "catalog:react18"
"@types/react": "catalog:react19",
"react": "catalog:react19"
},
"peerDependencies": {
"@suspensive/react": "workspace:^2.18.8",
"@tanstack/react-query": "^4",
"react": "^18"
"react": "^18 || ^19"
},
"peerDependenciesMeta": {
"@suspensive/react": {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-query-4/src/QueryClientConsumer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export function QueryClientConsumer({
children: (queryClient: QueryClient) => ReactNode
context?: Context<QueryClient | undefined>
}) {
return <>{children(useQueryClient({ context }))}</>
return <>{children(useQueryClient({ context: context as any }))}</>
}
6 changes: 3 additions & 3 deletions packages/react-query-5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
"@suspensive/tsconfig": "workspace:*",
"@suspensive/tsup": "workspace:*",
"@tanstack/react-query": "catalog:react-query5",
"@types/react": "catalog:react18",
"react": "catalog:react18"
"@types/react": "catalog:react19",
"react": "catalog:react19"
},
"peerDependencies": {
"@suspensive/react": "workspace:^2.18.8",
"@tanstack/react-query": "^5",
"react": "^18"
"react": "^18 || ^19"
},
"peerDependenciesMeta": {
"@suspensive/react": {
Expand Down
6 changes: 3 additions & 3 deletions packages/react-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@
"@suspensive/react": "workspace:*",
"@suspensive/tsconfig": "workspace:*",
"@suspensive/tsup": "workspace:*",
"@types/react": "catalog:react18",
"react": "catalog:react18"
"@types/react": "catalog:react19",
"react": "catalog:react19"
},
"peerDependencies": {
"@suspensive/react": "workspace:^2.18.8",
"@tanstack/react-query": "^4 || ^5",
"react": "^18"
"react": "^18 || ^19"
},
"peerDependenciesMeta": {
"@suspensive/react": {
Expand Down
6 changes: 3 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@
"@suspensive/eslint-config": "workspace:*",
"@suspensive/tsconfig": "workspace:*",
"@suspensive/tsup": "workspace:*",
"@types/react": "catalog:react18",
"react": "catalog:react18"
"@types/react": "catalog:react19",
"react": "catalog:react19"
},
"peerDependencies": {
"react": "^18"
"react": "^18 || ^19"
},
"publishConfig": {
"access": "public"
Expand Down
Loading

0 comments on commit 794b8db

Please sign in to comment.