diff --git a/examples/full/package.json b/examples/full/package.json
index e15b3de7..fef6872a 100644
--- a/examples/full/package.json
+++ b/examples/full/package.json
@@ -5,11 +5,9 @@
"preview": "vite build && vite preview"
},
"dependencies": {
- "@ant-design/cssinjs": "^1.22.1",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
- "antd": "^5.22.5",
"node-fetch": "^3.3.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
@@ -17,7 +15,6 @@
"typescript": "^5.5.4",
"vike": "^0.4.211",
"vike-react": "^0.5.11",
- "vike-react-antd": "^0.0.0",
"vite": "^5.4.0"
},
"type": "module"
diff --git a/examples/full/pages/+config.ts b/examples/full/pages/+config.ts
index 6f411159..05d71c61 100644
--- a/examples/full/pages/+config.ts
+++ b/examples/full/pages/+config.ts
@@ -2,7 +2,6 @@ export { config }
import type { Config } from 'vike/types'
import vikeReact from 'vike-react/config'
-import vikeReactAntd from 'vike-react-antd/config'
// Default configs (can be overridden by pages)
const config = {
@@ -15,5 +14,5 @@ const config = {
bodyAttributes: { class: 'dark' },
viewport: 999,
// https://vike.dev/extends
- extends: [vikeReact, vikeReactAntd],
+ extends: vikeReact,
} satisfies Config
diff --git a/examples/full/pages/index/+Page.tsx b/examples/full/pages/index/+Page.tsx
index 36eb50dc..e909569b 100644
--- a/examples/full/pages/index/+Page.tsx
+++ b/examples/full/pages/index/+Page.tsx
@@ -4,7 +4,6 @@ import React from 'react'
import { Counter } from '../../components/Counter'
import image from '../../assets/logo-new.svg'
import { Config } from 'vike-react/Config'
-import { Button, Flex } from 'antd'
function Page() {
// Will be printed on the server and in the browser:
@@ -21,10 +20,6 @@ function Page() {
Interactive.
-
-
-
-
>
)
}
diff --git a/packages/vike-react-antd/Wrapper.server.tsx b/packages/vike-react-antd/Wrapper.server.tsx
index d6a5718e..12c26bbb 100644
--- a/packages/vike-react-antd/Wrapper.server.tsx
+++ b/packages/vike-react-antd/Wrapper.server.tsx
@@ -7,13 +7,14 @@ import { usePageContext } from 'vike-react/usePageContext'
function Wrapper({ children }: { children: ReactNode }) {
const pageContext = usePageContext()
const { antd } = pageContext.config
+ const cache = 'antd' in pageContext ? pageContext.antd?.cache : undefined
- if (antd === null) {
+ if (antd === null || !cache) {
return <>{children}>
}
return (
-
+
{children}
)
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f18cfca2..db2121dd 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -77,9 +77,6 @@ importers:
examples/full:
dependencies:
- '@ant-design/cssinjs':
- specifier: ^1.22.1
- version: 1.22.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@types/react':
specifier: ^18.3.3
version: 18.3.3
@@ -89,9 +86,6 @@ importers:
'@vitejs/plugin-react':
specifier: ^4.3.1
version: 4.3.1(vite@5.4.0(@types/node@20.11.17))
- antd:
- specifier: ^5.22.5
- version: 5.22.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
node-fetch:
specifier: ^3.3.2
version: 3.3.2
@@ -113,9 +107,6 @@ importers:
vike-react:
specifier: link:../../packages/vike-react
version: link:../../packages/vike-react
- vike-react-antd:
- specifier: link:../../packages/vike-react-antd
- version: link:../../packages/vike-react-antd
vite:
specifier: ^5.4.0
version: 5.4.0(@types/node@20.11.17)