From 9b659442b718e72b0f64894e337c2b12a44a7ad4 Mon Sep 17 00:00:00 2001
From: Ben Croker <57572400+bencroker@users.noreply.github.com>
Date: Tue, 20 Aug 2024 20:36:49 +0200
Subject: [PATCH] Update sprig.md
---
docs/guides/sprig.md | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/docs/guides/sprig.md b/docs/guides/sprig.md
index ba9268a..c70a30d 100644
--- a/docs/guides/sprig.md
+++ b/docs/guides/sprig.md
@@ -60,9 +60,6 @@ Now that you have a copy of the `proximity-search` component, here's how to use
```twig
{# Dynamically inject Sprig component #}
{{ sprig('_components/proximity-search') }}
-
-{# Load required Sprig scripts #}
-{{ sprig.script }}
```
## Additional Information
@@ -79,9 +76,10 @@ It is important that the map ID in the [`googleMaps.init` method](/javascript/go
{# When the map is reloaded by Sprig #}
{% if sprig.isRequest %}
-
+ {% endset %}
+ {% do sprig.registerJs(js) %}
{% endif %}
```
@@ -93,11 +91,12 @@ The `init` method also allows for an optional [callback method](/javascript/goog
```twig
{% if sprig.isRequest %}
-
+ {% endset %}
+ {% do sprig.registerJs(js) %}
{% endif %}
```