-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 New Sandbox Modal #1194
Fix New Sandbox Modal #1194
Conversation
This is great! We need to merge some other stuff in to make it 'official'. These ones:
Then I have to add them to the server too, but that is almost no work. I was also thinking that we can enable Sapper now (it's just adding the |
Sapper updated 🎉 Merge this when the importers are merged as well then :) |
@@ -93,12 +92,27 @@ export default class Modal extends React.PureComponent { | |||
))} | |||
|
|||
<Title>Server Templates</Title> | |||
{mainServerRows.map((ts, i) => ( | |||
// eslint-disable-next-line react/no-array-index-key |
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.
You should not use indexes for keys. This can negatively impact performance and may cause issues with state.
refs
https://dev.to/pureooze/a-simple-list-render-optimization-for-react--5715
https://reactjs.org/docs/lists-and-keys.html#keys
facebook/react#1342 (comment)
https://medium.com/@robinpokorny/index-as-a-key-is-an-anti-pattern-e0349aece318
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.
The items rendered will not be changing, so nothing bad should come of using the index as the key here.
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.
Yeah, I know. But if someone isolate and compose this part of code, may affect it.
I always do this to ensure it will work regardless of context
What kind of change does this PR introduce?
Fixes the add create sandbox modal
What is the current behavior?
Overflowing because of server templates
What is the new behavior?
Checklist: