How to use categories with Sprig's "Load More" recipe I am trying out Sprig's &quot;Load More&quot; Recipe and I am trying to call up entries that are related to the current category page. But when I add .relatedTo(category) to the entry model, it doesn't work–it still just shows all the entries in the channel. I've used this .relatedTo(category) method elsewhere on the page (not using Sprig) and it works just fine. How can I call up only the entries that match the current category page in this Sprig recipe?
_category.twig
{{ sprig('_layouts/_categories/_loadMore', {limit: 6}) }}
{{ sprig.script }}

_loadMore.twig
{% set offset = offset ?? 6 %}
{% set limit = limit ?? 10 %}

{% set entries = craft.entries.section('aBetterPost').offset(offset).limit(limit).relatedTo(category).all() %}

{% for entry in entries %}

    &lt;a href=&quot;{{ entry.url }}&quot; class=&quot;more-post&quot;&gt;
        &lt;div class=&quot;more-post-img-wrap&quot;&gt;
            {% set featuredImage = entry.featuredImage.one() %}
            &lt;img src=&quot;{{ featuredImage.getUrl }}&quot; class=&quot;more-post-img&quot;&gt;
            &lt;div class=&quot;red-overlay&quot;&gt;&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;more-post-content&quot;&gt;
            &lt;div class=&quot;more-post-title&quot;&gt;
                &lt;h3&gt;{{ entry.title }}&lt;/h3&gt;
            &lt;/div&gt;
            &lt;div class=&quot;next-icon&quot;&gt;
                &lt;i class=&quot;fas fa-chevron-right&quot;&gt;&lt;/i&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/a&gt;

{% endfor %}

            
{% if entries %}

&lt;div class=&quot;load-button-wrap&quot; s-target=&quot;this&quot; s-swap=&quot;outerHTML&quot;&gt;
    &lt;input type=&quot;hidden&quot; name=&quot;offset&quot; value=&quot;{{ offset + limit }}&quot;&gt;
    &lt;button class=&quot;load-button&quot; sprig&gt;Load More&lt;/button&gt;
&lt;/div&gt;

{% endif %}
Try this:
{{ sprig('_layouts/_categories/_loadMore', {limit: 6, category: category}) }}
{{ sprig.script }}
After query category is not defined.