-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
docs: clarify useSelect state management behavior #7153
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
base: main
Are you sure you want to change the base?
Conversation
Added a warning note to the useSelect documentation clarifying that it does not manage the component's value state, addressing user confusion in issue refinedev#7121.
|
|
I noticed the Commitlint check failed, likely because my description line was too long. Since I submitted this via the GitHub Web UI, I can't easily amend the commit message. I'm happy to close and reopen if strict compliance is required, otherwise I assume this can be fixed via squash-merge! |
alicanerdurmaz
left a comment
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.
| > [!NOTE] | ||
| > The `useSelect` hook is designed primarily for data fetching (managing options, loading, pagination). It does not manage the controlled state (the selected value) of the component. | ||
| > [!NOTE] | ||
| > If you are using the `<Select>` component standalone, you must manage the `value` and `onChange` props using `useState`. If you are using it within a Form (like Ant Design's `<Form>`), the form item will handle the state for you. | ||
| Here is a basic example that uses the `useSelect` hook. |
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.
I believe these can be one paragraph.
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.
Thanks for the review! I've updated the formatting to use :::info (since [!NOTE] isn't supported) and condensed the text into a single paragraph as requested.
alicanerdurmaz
left a comment
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.
Thanks for the improving Refine. I left 2 comment, Please check when you have time
Updated the documentation for the useSelect hook to clarify its purpose regarding state management and data fetching.

Added a warning note to the useSelect documentation clarifying that it does not manage the component's value state, addressing user confusion in issue #7121.
PR Checklist
Please check if your PR fulfills the following requirements:
Bugs / Features
What is the current behavior?
What is the new behavior?
fixes (issue)
Notes for reviewers