Skip to content

Commit

Permalink
add documentation for vite_react_refresh nonce
Browse files Browse the repository at this point in the history
  • Loading branch information
Niicck committed Jan 22, 2024
1 parent 8c53b8b commit ed074ba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,13 @@ like the previous tag.**
```
{% vite_react_refresh %}
```
If you're using React, this will generate the Javascript needed to support React HMR.
If you're using React, this will generate the Javascript `<script/>` needed to support React HMR.

```
{% vite_react_refresh nonce="{{ request.csp_nonce }}" %}
```

Any kwargs passed to vite_react_refresh will be added to its generated `<script/>` tag. For example, if your site is configured with a Content Security Policy using [django-csp](https://github.com/mozilla/django-csp) you'll want to add this value for `nonce`.

### Custom attributes

Expand Down

0 comments on commit ed074ba

Please sign in to comment.