Repository navigation
fix(core): keep null-valued props spread into a component - #9193
Merged
Varixo merged 1 commit intoOct 9, 2026
Merged
Conversation
_jsxSplit deletes every null var prop to clean up event-conversion markers,
but that conversion only happens on native elements. On a component it
dropped real props, so `{...{ s: null }}` arrived without `s` while
`s={null}` kept it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: b1b6348 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@qwik.dev/core
@qwik.dev/router
@qwik.dev/utils
eslint-plugin-qwik
create-qwik
@qwik.dev/optimizer
@qwik.dev/devtools
@qwik.dev/mcp
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is it?
Description
Spreading an object into a component drops every key whose value is
null:The key is missing only when it's spread. Explicit props keep
null, and anundefinedvalue survives the spread. A component typeds: T | nulltherefore getsundefined, andprops.s !== nullistrue. We hit this in a list built by spreading GraphQL results into a card component. GraphQL usesnullfor absent values, so every card read as "sponsored". On v1 thenullarrives.Cause
When there's a spread, the optimizer emits
_jsxSplit. At the end it removes everynullvar prop:Those markers come from event-prop conversion, which
_jsxSplitonly does for native elements (typeof type === 'string'). On a component the same check deletes real props.Fix
Only run the null cleanup for native elements, the same condition
_jsxSplitalready uses for its other element-only transforms. Elements are unchanged: a spreadnullattribute is still dropped, which is whatnullmeans for an attribute.Tests
A new test in
component.spec.tsxspreads{ a: 1, s: null }into a component and checkssarrives asnull. It runs under bothssrRenderToDomanddomRender, fails onmain(expected 'false:false' to be 'true:true'), and passes with the fix. The fullpackages/qwik/src/coresuite passes (2394 tests).Checklist
pnpm change