Check out example codes for "nav bar activate in jinja". It will help you in understanding the concepts better.

Code Example 1

{% extends "layout.html" %}
{% set active_page = "index" %}

Code Example 2

{% set navigation_bar = [
    ('/', 'index', 'Index'),
    ('/downloads/', 'downloads', 'Downloads'),
    ('/about/', 'about', 'About')
] -%}

{% set active_page = active_page|default('index') -%}
...
<ul id="navigation">
    {% for href, id, caption in navigation_bar %}
    <li{% if id == active_page %} class="active"{% endif
    %}><a href="{{ href|e }}">{{ caption|e }}</a>
    </li>
{% endfor %}
</ul>

Learn ReactJs, React Native from akashmittal.com