I'm trying to create a load more function using a filtered set of entries, then passing those entries into the Load More component using Sprig.
I get the error "Impossible to invoke a method ("offset") on an array."
This is the code
Template
{# If the user has selected "Auto" it'll auto populate below from section selected. #}
{% if block.blockItemsManual|length %}
{% set entries = block.blockItemsManual.entries.all() %}
{% else %}
{% set entries = craft.entries.section(block.blockItemsAuto).all() %}
{% endif %}
{# Show a Load More button that loads in more data via Sprig #}
{{ sprig('_components/loadMore_grid', {'limit': 3, 'selectedEntries': entries }) }}
{{ sprig.script }}
Component
{# Sets a default value if not defined by the `s-val:*` attribute on the button #}
{% set offset = offset ?? 0 %}
{% set entryQuery = selectedEntries.offset(offset).limit(limit) %}
{% set entries = entryQuery.all() %}
{% for entry in entries %}
......