-
Notifications
You must be signed in to change notification settings - Fork 23
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
#8320: prevent IsolatedComponent and brick renderers from recreating components #8325
#8320: prevent IsolatedComponent and brick renderers from recreating components #8325
Conversation
@@ -299,24 +315,8 @@ export class CustomFormRenderer extends RendererABC { | |||
normalizedData, | |||
}); | |||
|
|||
const CustomFormComponent: React.FunctionComponent< |
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.
We were recreating the component on every render. I believe I've caught everywhere we were doing this.
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've seen this issue come up a few times in the past on my previous team as well. I wonder if there is a lint rule for this.
edit: aha, I found this:
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md
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.
Oh, this isn't caught because this isn't within a React component... it's our own custom class definition.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8325 +/- ##
=======================================
Coverage 73.50% 73.51%
=======================================
Files 1330 1330
Lines 41089 41090 +1
Branches 7625 7626 +1
=======================================
+ Hits 30202 30206 +4
+ Misses 10887 10884 -3 ☔ View full report in Codecov by Sentry. |
@@ -200,6 +200,22 @@ export const CUSTOM_FORM_SCHEMA = { | |||
required: ["schema"], | |||
}; | |||
|
|||
const IsolatedCustomFormComponent: React.FunctionComponent< |
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.
Renamed each to Isolated...
to make the React Dev Tools more useful.
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.
Makes sense to me!
When the PR is merged, the first loom link found on this PR will be posted to |
…od' of github.com:pixiebrix/pixiebrix-extension into 8320-search-field-loses-focus-while-typing-on-snippet-mod
const input = sideBarPage.getByPlaceholder("Search snippets"); | ||
await input.click(); | ||
// Add delay to give time for the the input to lose focus | ||
await input.pressSequentially("abc", { delay: 100 }); |
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.
💯
What does this PR do?
Remaining Work
Demo
Checklist