Skip to content
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

feat(Icon|Flag): PureComponent for Icon/Flag #2067

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/elements/Flag/Flag.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export interface FlagProps {
'zambia' | 'zw' | 'zimbabwe';
}

declare class Flag extends React.Component<FlagProps, {}> {
declare class Flag extends React.PureComponent<FlagProps, {}> {
}

export default Flag;
4 changes: 2 additions & 2 deletions src/elements/Flag/Flag.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import cx from 'classnames'
import PropTypes from 'prop-types'
import React, { Component } from 'react'
import React, { PureComponent } from 'react'

import {
createShorthandFactory,
Expand Down Expand Up @@ -58,7 +58,7 @@ const names = [
/**
* A flag is is used to represent a political state.
*/
class Flag extends Component {
class Flag extends PureComponent {
static propTypes = {
/** An element type to render as (string or function). */
as: customPropTypes.as,
Expand Down
2 changes: 1 addition & 1 deletion src/elements/Icon/Icon.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface IconProps {
size?: IconSizeProp;
}

declare class Icon extends React.Component<IconProps, {}> {
declare class Icon extends React.PureComponent<IconProps, {}> {
Group: typeof IconGroup;
}

Expand Down
4 changes: 2 additions & 2 deletions src/elements/Icon/Icon.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import cx from 'classnames'
import _ from 'lodash'
import PropTypes from 'prop-types'
import React, { Component } from 'react'
import React, { PureComponent } from 'react'

import {
createShorthandFactory,
Expand All @@ -20,7 +20,7 @@ import IconGroup from './IconGroup'
* An icon is a glyph used to represent something else.
* @see Image
*/
class Icon extends Component {
class Icon extends PureComponent {
static propTypes = {
/** An element type to render as (string or function). */
as: customPropTypes.as,
Expand Down