summaryrefslogtreecommitdiff
path: root/packages/integrations/react/src
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@skypack.dev> 2023-09-06 21:13:36 +0800
committerGravatar GitHub <noreply@github.com> 2023-09-06 09:13:36 -0400
commit67e83485949cf21de62831731111413abf57718c (patch)
treed0856e146b1397fca0d5c9ce4aa51a53059c768b /packages/integrations/react/src
parent1947ef7a99ce3d1d6ea797842edd31d5edffa5de (diff)
downloadastro-67e83485949cf21de62831731111413abf57718c.tar.gz
astro-67e83485949cf21de62831731111413abf57718c.tar.zst
astro-67e83485949cf21de62831731111413abf57718c.zip
Fix React dev mode using a base (#8428)
Diffstat (limited to 'packages/integrations/react/src')
-rw-r--r--packages/integrations/react/src/index.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/packages/integrations/react/src/index.ts b/packages/integrations/react/src/index.ts
index a09544baf..2a78ce9cd 100644
--- a/packages/integrations/react/src/index.ts
+++ b/packages/integrations/react/src/index.ts
@@ -1,4 +1,3 @@
-import { appendForwardSlash } from '@astrojs/internal-helpers/path';
import react, { type Options as ViteReactPluginOptions } from '@vitejs/plugin-react';
import type { AstroIntegration } from 'astro';
import { version as ReactVersion } from 'react-dom';
@@ -94,7 +93,7 @@ export default function ({
return {
name: '@astrojs/react',
hooks: {
- 'astro:config:setup': ({ config, command, addRenderer, updateConfig, injectScript }) => {
+ 'astro:config:setup': ({ command, addRenderer, updateConfig, injectScript }) => {
addRenderer(getRenderer());
updateConfig({
vite: getViteConfiguration({ include, exclude, experimentalReactChildren }),
@@ -102,7 +101,7 @@ export default function ({
if (command === 'dev') {
const preamble = FAST_REFRESH_PREAMBLE.replace(
`__BASE__`,
- appendForwardSlash(config.base)
+ '/'
);
injectScript('before-hydration', preamble);
}