Skip to content

Commit

Permalink
docs: update react preamble instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Feb 12, 2021
1 parent 72df711 commit 7d65399
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/guide/backend-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ If you want to serve the HTML using a traditional backend (e.g. Rails, Laravel)

Also make sure the server is configured to serve static assets in the Vite working directory, otherwise assets such as images won't be loaded properly.

Note if you are using React with `@vitejs/plugin-react-refresh`, you'll also need to add this, since the plugin is not able to modify the HTML you are serving:
Note if you are using React with `@vitejs/plugin-react-refresh`, you'll also need to add this before the above scripts, since the plugin is not able to modify the HTML you are serving:

```html
<script type="module">
import RefreshRuntime from "/@react-refresh"
import RefreshRuntime from "http://localhost:3000/@react-refresh"
RefreshRuntime.injectIntoGlobalHook(window) window.$RefreshReg$ = () => {}
window.$RefreshSig$ = () => (type) => type
window.__vite_plugin_react_preamble_installed__ = true
Expand Down

0 comments on commit 7d65399

Please sign in to comment.