# Conditional Rendering SPA

**URL:** <https://community.weweb.io/t/conditional-rendering-spa/3512>\
**Category:** Ask us anything\
**Created:** [July 13, 2023, 4:16pm UTC](https://community.weweb.io/t/conditional-rendering-spa/3512 "2023-07-13T16:16:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/mark/32/4163_2.png) [@mark](https://community.weweb.io/u/mark)\
**Post date:** [July 13, 2023, 4:16pm UTC](https://community.weweb.io/t/conditional-rendering-spa/3512/1 "2023-07-13T16:16:48Z")

</div>

Hi, In order to get my app to act as a single page app should I be using Conditional Rendering over Conditional Display? (Provided I don’t need to access variables from one tab to the next)

Also, with Conditional Rendering, when something meets the conditions and is rendered, then at a certain point it does not meet the condition anymore, does that just hide it or does it remove it from the DOM as well?

---

<div class="post-metadata">

**Author:** ![aurelie](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/aurelie/32/13249_2.png) [@aurelie](https://community.weweb.io/u/aurelie)\
**Post date:** [July 13, 2023, 4:21pm UTC](https://community.weweb.io/t/conditional-rendering-spa/3512/2 "2023-07-13T16:21:20Z")

</div>

Hi,  
Weweb is an spa by design, so no need to use conditional rendering, you can safely create different pages.  
You can use linked section if you wish to have a common header or navbar.

Conditional rendering mount and unmount the html from the DOM each time the condition changed.

---

<div class="post-metadata">

**Author:** ![mark](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/mark/32/4163_2.png) [@mark](https://community.weweb.io/u/mark)\
**Post date:** [July 13, 2023, 4:30pm UTC](https://community.weweb.io/t/conditional-rendering-spa/3512/4 "2023-07-13T16:30:09Z")

</div>

Thanks! So just to make sure I’m clear, when I ‘Change Pages’ the navbar won’t reload like it behaves in the preview?

I haven’t published the app yet so I’m unsure of how it will behave when published. Is the reloading of everything just because I’m in the editor

---

<div class="post-metadata">

**Author:** ![aurelie](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/aurelie/32/13249_2.png) [@aurelie](https://community.weweb.io/u/aurelie)\
**Post date:** [July 13, 2023, 6:39pm UTC](https://community.weweb.io/t/conditional-rendering-spa/3512/5 "2023-07-13T18:39:25Z")

</div>

If you use shared section, no the navbar will not reload 🙂 (but you need the section to be linked)

---

<div class="post-metadata">

**Author:** ![Quentin](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/quentin/32/6_2.png) [@Quentin](https://community.weweb.io/u/Quentin)\
**Post date:** [July 17, 2023, 3:01pm UTC](https://community.weweb.io/t/conditional-rendering-spa/3512/6 "2023-07-17T15:01:53Z")

</div>

Here’s some docs that should help → [Sections | Weweb documentation](https://docs.weweb.io/add-elements/elements/sections.html#how-to-duplicate-a-section)

Basically, when duplicating a section, select `Create an Instance` to make it a multi-page section.
