Skip to content

Conversation

@seefeldb
Copy link
Contributor

@seefeldb seefeldb commented Oct 24, 2025

Previously, false values in children would render as the text 'false'. Now false is treated the same as null and undefined - it renders as an empty text element (nothing visible).

This aligns with common JSX/React behavior where boolean false is used for conditional rendering and should not produce output.

  • Updated render.ts to check for false in addition to null/undefined
  • Added test case verifying false, null, undefined render as empty
  • Updated html-recipes test to use str template for explicit string conversion

🤖 Generated with Claude Code


Summary by cubic

Treat boolean false like null/undefined during HTML rendering, so it doesn’t produce visible text. This prevents stray “false” in the DOM and matches JSX/React conditional rendering.

  • Bug Fixes
    • Normalize false to empty text in children handling in render.ts.
    • Add tests asserting false/null/undefined render empty and true renders "true".
    • Update html-recipes test to use str template for explicit string conversion.

Previously, false values in children would render as the text 'false'.
Now false is treated the same as null and undefined - it renders
as an empty text element (nothing visible).

This aligns with common JSX/React behavior where boolean false is
used for conditional rendering and should not produce output.

- Updated render.ts to check for false in addition to null/undefined
- Added test case verifying false, null, undefined render as empty
- Updated html-recipes test to use str template for explicit string conversion

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@seefeldb seefeldb requested a review from jsantell October 24, 2025 23:14
@seefeldb
Copy link
Contributor Author

this is because of all the (condition) && (<div>..</div>) that appear in generated patterns, that before this get rendered as false.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

@seefeldb seefeldb merged commit 8056036 into main Oct 25, 2025
9 checks passed
@seefeldb seefeldb deleted the fix/do-not-render-false branch October 25, 2025 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants