Skip to content

Commit

Permalink
Extend PureComponent, #7
Browse files Browse the repository at this point in the history
  • Loading branch information
ultraq committed Jul 28, 2022
1 parent 7976b43 commit dee06be
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,7 @@

Changelog
=========

### 0.10.0
- Have `<FormattedMessage>` extend `PureComponent` as a performance
optimization ([#7](https://github.com/ultraq/react-icu-message-formatter/issues/7))
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@ultraq/react-icu-message-formatter",
"version": "0.10.0",
"version": "0.10.0-beta.0",
"description": "React wrapper for the lightweight ICU message formatter",
"author": "Emanuel Rabina <emanuelrabina@gmail.com> (http://www.ultraq.net.nz/)",
"license": "Apache-2.0",
Expand Down
12 changes: 6 additions & 6 deletions source/FormattedMessage.js
Expand Up @@ -14,12 +14,12 @@
* limitations under the License.
*/

import MessageFormatterContext from './MessageFormatterContext.js';
import MessageFormatterContext from './MessageFormatterContext.js';

import {flatten} from '@ultraq/array-utils';
import {escapeHtml} from '@ultraq/string-utils';
import PropTypes from 'prop-types';
import React, {Component, Fragment} from 'react';
import {flatten} from '@ultraq/array-utils';
import {escapeHtml} from '@ultraq/string-utils';
import PropTypes from 'prop-types';
import React, {Fragment, PureComponent} from 'react';

/**
* Return a copy of the passed object whose string values have been
Expand Down Expand Up @@ -72,7 +72,7 @@ function groupStrings(formatParts) {
*
* @author Emanuel Rabina
*/
export default class FormattedMessage extends Component {
export default class FormattedMessage extends PureComponent {

static contextType = MessageFormatterContext;
static propTypes = {
Expand Down

0 comments on commit dee06be

Please sign in to comment.