Conversation
|
|
✅ Deploy Preview for solid-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
may address |
| <button onClick={() => setCount((c) => c + 1)}>Increment</button> | ||
| {/* This does not update because the count signal is not being tracked. */} | ||
| <Show when={count()}>{(c) => count()}</Show> | ||
| {/* This will update because the outer JSX element creates a tracking scope. */} |
There was a problem hiding this comment.
I think this should be "inner JSX element" not "outer"
There was a problem hiding this comment.
It's outer in the sense that it wraps the expression, but I understand that it might be confusing. I don't think "inner JSX element" is necessarily better. Perhaps we can explain it more clearly:
Wrapping the expression in a JSX element creates a tracking scope, which makes it reactive.
There was a problem hiding this comment.
{/* This will update because the returned JSX element creates a new tracking scope. */}There was a problem hiding this comment.
After further consideration, I have decided to leave it as is. I believe the confusion surrounding the term "outer" is not substantial. Since there are two similar <Show> components, with the only difference being that the second one is wrapped in a fragment, it's easy for users to understand what it means. Additionally, I couldn't think of a phrasing that would meaningfully improve this.
Thank you for your feedback and suggestions. If you disagree with this decision, please feel free to create an issue or pull request so we can discuss it further. Since this PR has already been merged, I prefer to continue the conversation elsewhere.
Description(required)
This PR improves the reference page for the
<Show>component by providing more information about thekeyedprop and the render function. I also took the opportunity to clean up and improve the overall structure.Related: #1164