-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Render children in MySelect component to display options #3998
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
@@ -849,12 +849,13 @@ const MyCheckbox = ({ children, ...props }) => { | |||
); | |||
}; | |||
|
|||
const MySelect = ({ label, ...props }) => { | |||
const MySelect = ({children, label, ...props }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const MySelect = ({children, label, ...props }) => { | |
const MySelect = ({ children, label, ...props }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks 😄
Even after merging the commit why website is not reflecting the updated changes |
The original example did not render the children prop, which resulted in the select element not displaying the options passed as children. This PR updates the MySelect component to properly handle the children prop and render the options inside the dropdown.
Changes Made
Updated MySelect component to include the children prop inside the select element.
This ensures that the options passed as children (e.g., tags) are correctly displayed in the dropdown list.
Issue Addressed
Incorrect example in the documentation where options passed to the MySelect component were not being rendered.
Testing
Verified that the options now render correctly in the MySelect component by testing it with the provided example from the tutorial.
Additional Notes
This PR only fixes the example in the docs and does not introduce any breaking changes.