Skip to content

Commit

Permalink
fix(flyout): memoize selection component
Browse files Browse the repository at this point in the history
  • Loading branch information
tbuchann committed Dec 1, 2021
1 parent 92cf862 commit 18b24b6
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,8 @@ const PlusMinusIconWrapper = styled.div`

type Props = OwnProps & ParentOwnProps & SuccessStateType

class Success extends React.Component<Props> {
shouldComponentUpdate = (nextProps) => !equals(this.props, nextProps)

render() {
const { coin, fiat, onClick, orderType, rates } = this.props
const Success = React.memo(
({ coin, fiat, onClick, orderType, rates }: Props) => {
const { coinfig } = window.coins[coin]
const displayName = coinfig.name

Expand Down Expand Up @@ -116,7 +113,8 @@ class Success extends React.Component<Props> {
)}
</CheckoutDisplayContainer>
)
}
}
},
(prevProps, nextProps) => equals(prevProps, nextProps)
)

export default Success

0 comments on commit 18b24b6

Please sign in to comment.