solid-start: does not support reactive values?</h1> <div class="body"><pre><code> <Title> {appState.title ? `${appState.title} - RedditLattice` : `RedditLattice`} </Title> </code></pre> <p>This in my root.tsx doesn’t work and I have confirmed with a console log in a createEffect that appState.title does trigger a signal to change.</p> <p>Relevant Source Code: <a href="https://github.com/vanillacode314/redditlattice/blob/solidjs/src/root.tsx">https://github.com/vanillacode314/redditlattice/blob/solidjs/src/root.tsx</a></p> </div> </section> <section class="issueAnalyticsMobile" id="analytics"> <h2>About this issue</h2> <ul> <li><a href="https://github.com/solidjs/solid-start/issues/308" rel="nofollow">Original URL</a></li> <li>State: closed</li> <li>Created 2 years ago</li> <li>Comments: 15 (2 by maintainers)</li> </ul> </section><section class="issueComments" id="topComments"> <h2>Most upvoted comments</h2> <div class="comments"> <div class="comment" key="0"> <div class="commentBody"><p>fixed upstream in <a href="https://github.com/orgs/solidjs/teams/meta">@solidjs/meta</a></p> </div> <div class="commentMetadata"> <div class="reactions"> <span>+2</span> </div> <div class="attribution"> <a href="https://github.com/vanillacode314" rel="nofollow">vanillacode314</a> on <a href="https://github.com/solidjs/solid-start/issues/308#issuecomment-1312464153" rel="nofollow">Nov 12, 2022</a> </div> </div> </div><div class="comment" key="1"> <div class="commentBody"><p>Yeah you are probably right about the bug… and you are right about your assumption about the JSX. Ternaries are reactive. And <code>Show</code> basically is slightly more optimal where it will avoid recreating dom elements if it doesn thave to.</p> </div> <div class="commentMetadata"> <div class="reactions"> <span>+1</span> </div> <div class="attribution"> <a href="https://github.com/nksaraf" rel="nofollow">nksaraf</a> on <a href="https://github.com/solidjs/solid-start/issues/308#issuecomment-1294065630" rel="nofollow">Oct 27, 2022</a> </div> </div> </div><div class="comment" key="2"> <div class="commentBody"><p><strong>Edit:</strong> after looking into this a bit closer, it seems like I had a bug in my own code, and the first behavior I described doesn’t really happen. It’s working fine. The other bug (empty tag) does still happen under some circumstances.</p> <hr> <p>Hi, ~I’ve also run into this bug, <code><Title /></code> just doesn’t behave as other head tags would (e.g. <code>Meta</code>, where the lowest tag “wins” and replaces any previous ones), which is unexpected~, plus I’ve also run into empty <code><title></code> on client-side navigation as <a href="https://github.com/gcavanunez">@gcavanunez</a> shared.</p> <p>Also, I’m fairly new to Solid so I might be confused, but my understanding is that anything inside of a JSX expression is reactive, as JSX expressions get essentially compiled to “smart” <code>createEffect</code>-like calls, so a ternary (or absolutely any JavaScript expression that correctly uses signal or store accessors) should work, without the need for <code>Show</code>, although it’s also my understanding that <code>Show</code> has some advantages that I don’t remember right now over certain plain JS conditional expressions, iirc.</p> <p>In conclusion, there’s definitely something broken with <code>Title</code> in need of a bug fix, I’ve confirmed this in my blog 😛</p> </div> <div class="commentMetadata"> <div class="reactions"> <span>+1</span> </div> <div class="attribution"> <a href="https://github.com/DaniGuardiola" rel="nofollow">DaniGuardiola</a> on <a href="https://github.com/solidjs/solid-start/issues/308#issuecomment-1293491039" rel="nofollow">Oct 27, 2022</a> </div> </div> </div> </div> <div class="moreComments"> <a href="https://github.com/solidjs/solid-start/issues/308" rel="nofollow">Read more comments on GitHub</a> </div> </section><section class="issueNavigation"> <div class="back"> <a href="https://errorism.dev/issues/solidjs-solid-start-bug-types-error-with-vinxi"> ← solid-start: [Bug?]: Types error with Vinxi </a> </div> <div class="forward"> <a href="https://errorism.dev/issues/solidjs-solid-start-typescript-tsc-can-not-exclude-node_modulessolid-start"> solid-start: Typescript `tsc` can not exclude `node_modules/solid-start/` → </a> </div> </section> </div> <aside class="sidebar"> <div class="tocWrapper"> <span class="tocTitle">Table of contents</span> <a class="tocItem" href="#issueDescription">Issue description</a> <a class="tocItem" href="#topComments">Top comments</a> </div> <div class="analyticsWrapper"> <span class="analyticsTitle">About this issue</span> <a class="analyticsItem" href="https://github.com/solidjs/solid-start/issues/308" rel="nofollow">Original URL</a> <span class="analyticsItem">State: closed</span> <span class="analyticsItem">Created 2 years ago</span> <span class="analyticsItem">Comments: 15 (2 by maintainers)</span> </div> </aside> </div> </main> <!--<footer class="footerContainer">--> <!-- <div class="footerContent">--> <!-- <div class="footerLinks">--> <!-- <a class="footerLink" href="/about">About Errorism</a>--> <!-- <a class="footerLink" href="/privacy-policy">Privacy Policy</a>--> <!-- <a class="footerLink" href="/contact">Contact</a>--> <!-- </div>--> <!-- </div>--> <!--</footer>--> </div> </body></html>