Skip to content

Commit 1f21006

Browse files
used React.memo to prevent unnecessary re-renders
1 parent e4f9530 commit 1f21006

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client/modules/IDE/components/EditorAccessibility.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
22
import React from 'react';
33
import { useTranslation } from 'react-i18next';
44

5-
const EditorAccessibility = ({ lintMessages = [], currentLine }) => {
5+
const EditorAccessibility = React.memo(({ lintMessages = [], currentLine }) => {
66
const { t } = useTranslation();
77
const lineText = t('Editor.KeyUpLineNumber', { lineNumber: currentLine });
88

@@ -34,7 +34,7 @@ const EditorAccessibility = ({ lintMessages = [], currentLine }) => {
3434
</p>
3535
</div>
3636
);
37-
};
37+
});
3838

3939
EditorAccessibility.propTypes = {
4040
lintMessages: PropTypes.arrayOf(

0 commit comments

Comments
 (0)