Skip to content

Commit

Permalink
Revert "test"
Browse files Browse the repository at this point in the history
This reverts commit 5063795.
  • Loading branch information
phonzammi committed Dec 28, 2024
1 parent 3faeeef commit f0bbbbc
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 21 deletions.
3 changes: 0 additions & 3 deletions examples/full/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@
"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",
"react-streaming": "^0.3.43",
"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"
Expand Down
3 changes: 1 addition & 2 deletions examples/full/pages/+config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -15,5 +14,5 @@ const config = {
bodyAttributes: { class: 'dark' },
viewport: 999,
// https://vike.dev/extends
extends: [vikeReact, vikeReactAntd],
extends: vikeReact,
} satisfies Config
5 changes: 0 additions & 5 deletions examples/full/pages/index/+Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -21,10 +20,6 @@ function Page() {
Interactive. <Counter />
</li>
</ul>
<Flex gap="small" wrap>
<Button type="primary">Primary Button</Button>
<Button>Default Button</Button>
</Flex>
</>
)
}
5 changes: 3 additions & 2 deletions packages/vike-react-antd/Wrapper.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<StyleProvider cache={pageContext.antd?.cache} {...antd}>
<StyleProvider cache={cache} {...antd}>
{children}
</StyleProvider>
)
Expand Down
9 changes: 0 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f0bbbbc

Please sign in to comment.