-
Notifications
You must be signed in to change notification settings - Fork 190
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
bug/fix_select_rending #2791
base: dev
Are you sure you want to change the base?
bug/fix_select_rending #2791
Conversation
|
WalkthroughThe changes made to the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- apps/backoffice-v2/src/lib/blocks/components/EditableDetails/EditableDetails.tsx (1 hunks)
🧰 Additional context used
@@ -346,6 +346,7 @@ export const EditableDetails: FunctionComponent<IEditableDetails> = ({ | |||
)} | |||
{isSelect && ( | |||
<Select | |||
key={keyFactory(field.value, title, `select`, id)} |
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.
Avoid changing the component's key based on field.value
Assigning a dynamic key
that depends on field.value
causes the Select
component to unmount and remount whenever the value changes. This can lead to loss of internal state and can negatively impact performance. Instead of modifying the key
, consider managing the re-rendering through state updates or using useEffect
to handle changes.
fix: added key for re-rending over value change
Summary by CodeRabbit
New Features
Select
component for enhanced form input options.Bug Fixes
Improvements