fix: withUniwind remove className props on web after converting them - #615
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe auto and manual Uniwind HOCs now shallow-copy incoming props and remove styling props after processing them. Tests verify generated styles and colors remain forwarded while source class props are omitted. ChangesHOC prop filtering
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR prevents processed styling props from being forwarded on web.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/uniwind/src/hoc/withUniwind.tsx | Separates immutable source reads from the forwarded prop clone, fixing shared manual-source handling while removing converted props. |
| packages/uniwind/tests/web/hoc/withUniwind.test.tsx | Extends web HOC coverage to verify generated styles and colors are retained while processed source props are omitted. |
Reviews (2): Last reviewed commit: "chore: fixes" | Re-trigger Greptile
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/uniwind/src/hoc/withUniwind.tsx`:
- Line 49: Update the early-return branch in withUniwind so it also deletes the
color class source prop when both color and colorClassName are provided, before
returning. Preserve the existing deletion at the later filtering point and
ensure the wrapped component never receives colorClassName when the inline color
takes precedence.
- Around line 92-98: Update withManualUniwind so the reducer reads each
mapping’s source value from originalProps rather than the mutable props object,
allowing multiple target props to reuse the same fromClassName. Continue
deleting consumed source properties only from props so they are excluded from
forwarded props.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a9d3c25c-e9fe-4e58-ae1f-85e6ffb5363d
📒 Files selected for processing (2)
packages/uniwind/src/hoc/withUniwind.tsxpackages/uniwind/tests/web/hoc/withUniwind.test.tsx
#614
Summary by CodeRabbit