I need to check if the variable texts is defined or not in index.html.
texts
index.html
If the variable is defined and not empty then I should render the loop.
This is a neat and simple solution that worked well for me!
{% if texts is defined and texts[0] is defined %} ... {% endif %}