Skip to content

Conversation

@MaxLee-dev
Copy link
Contributor

@MaxLee-dev MaxLee-dev commented Dec 24, 2025

Summary

  • Fix React warning: Invalid prop 'ref' supplied to 'React.Fragment'
  • When createRender returns a Fragment, wrap it in a render callback to prevent useRender from attempting to merge props via cloneElement

Problem

useRender internally calls React.cloneElement(render, mergedProps) which tries to pass props (including ref) to Fragment elements. Since Fragment only accepts key and children, this causes React warnings.

Solution

Detect Fragment elements and return them wrapped in a render callback () => fragment. When useRender receives a function, it calls it directly instead of using cloneElement, avoiding the props merge issue.

When createRender returns a Fragment (either as children, fallback, or
wrapped non-element), useRender's internal cloneElement call attempts
to merge props (including ref) into the Fragment, causing React warnings.

This fix wraps Fragment returns in a render callback, which useRender
calls directly instead of using cloneElement, preventing the props
merge attempt.
@changeset-bot
Copy link

changeset-bot bot commented Dec 24, 2025

🦋 Changeset detected

Latest commit: 131aeaf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@vapor-ui/core Patch
figma-plugin Patch
website Patch

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

@vercel
Copy link

vercel bot commented Dec 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
vapor-ui Ready Ready Preview, Comment Dec 24, 2025 2:52am

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @MaxLee-dev, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a specific React warning related to passing props to React.Fragment components when using the useRender hook. The createRender utility has been enhanced to intelligently handle Fragment elements by wrapping them in a render callback, thereby bypassing the prop merging mechanism that caused the warning. This change ensures cleaner console output and more robust rendering behavior without introducing unnecessary DOM elements.

Highlights

  • Fix React Warning: Addressed and resolved the React warning: "Invalid prop 'ref' supplied to 'React.Fragment'" which occurred when useRender attempted to pass props to Fragment elements.
  • Fragment Handling in createRender: Modified the createRender utility to detect React.Fragment elements. When a Fragment is encountered, it is now wrapped in a render callback (() => fragment) to prevent useRender from using React.cloneElement and erroneously merging props.
  • Improved Test Coverage: New test cases have been added to create-renderer.test.tsx specifically to validate the correct handling of Fragment elements, ensuring the fix works as expected for both children and fallback scenarios.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

안녕하세요. createRender에서 Fragment를 처리할 때 발생하는 React 경고를 수정해주셨네요. Fragment를 렌더 콜백으로 감싸서 useRendercloneElement를 호출하지 않도록 하는 해결책이 인상적입니다. 또한, 다양한 케이스를 커버하도록 테스트 코드를 구조적으로 개선해주셔서 코드의 안정성이 더욱 높아졌습니다. 좋은 수정 감사합니다!

@vapor-ui
Copy link
Collaborator

vapor-ui commented Dec 24, 2025

All tests passed!

Tests Passed Failed Duration Report
136 136 0 2m 23s Open report ↗︎

Click here if you need to update snapshots.

@MaxLee-dev MaxLee-dev added the type: bug Issues related to bug fixes label Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Issues related to bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants