Hey astronauts,
is it possible to render a script only if the condition is set to true, something like this ?
I get an error that i can not import things from outside a module, is there a way to fix this or a work around?
---
import { CONDITION } from 'Theme_Config'
---
<!-- Some HTML stuff -->
<nav>
<a href="!#">Link</a>
<a href="!#">Link</a>
<a href="!#">Link</a>
</nav>
<!-- Get the script if condition is set to true -->
{
CONDITION && (
<script>
import { VALUE_FROM_CONFIG } from 'Theme_Config'
// Do things with VALUE_FROM_CONFIG
</script>
)}