Uh oh!
There was an error while loading. Please reload this page.
feat: can use a wrapper on panel when using items props of collapse - #335
feat: can use a wrapper on panel when using items props of collapse#335Asanio06 wants to merge 1 commit into
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## master #335 +/- ##
==========================================
- Coverage 99.12% 98.29% -0.84%
==========================================
Files 5 5 Lines 114 117 +3 Branches 40 41 +1 ==========================================
+ Hits 113 115 +2 - Misses 1 2 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
nrps9909
left a comment
There was a problem hiding this comment.
I checked exact head cb9d48073b0b0ea94ebd022c824c7c7be8347e32. The new public API is not type-correct as written: ItemType.wrapper is declared as ReactNode, but convertItemsToNodes calls it as wrapper(collapsePanel).
Running npx tsc --noEmit --ignoreDeprecations 6.0 reports the issue directly at src/hooks/useItems.tsx:74:
TS2349: This expression is not callable.
No constituent of type 'string | number | bigint | true | ReactElement<...> | Iterable<ReactNode> | ReactPortal | Promise<...>' is callable.
This also means the intended consumer form, such as wrapper: panel => <Context.Provider value={...}>{panel}</Context.Provider>, cannot satisfy the exported ItemType contract. Please type the render callback explicitly (for example, (panel: React.ReactElement) => React.ReactNode, with the exact element type narrowed as appropriate) and add both a type/API regression and a runtime test for the wrapper path. The runtime regression should also rerender/reorder multiple keyed items so the wrapper does not accidentally discard top-level key identity.
For context, the existing runtime suite passes (1 suite, 92 tests, 1 snapshot), but it does not exercise wrapper; both Codecov project and patch checks are currently failing. This needs the public type and coverage fixed before merge.
AI assistance disclosure: Codex was used to inspect the exact diff, run the repository test/type checks, and draft this review. I verified the reported compiler output against the PR head above.
Today its not possible to add some wrapper like Context when using items props with Collapse