FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

PF3 Card use break with webpack tree shaking on when using embedded sub-components · Issue #2931 · patternfly/patternfly-react · GitHub

PF3 Card use break with webpack tree shaking on when using embedded sub-components #2931

Description

Using the following style, the Card component breaks with webpack tree shaking (i.e. production mode) turned on:

import React from 'react'
import PropTypes from 'prop-types'
import Format from 'intl-messageformat'
import { Card, Icon } from 'patternfly-react'

const UpgradeReview = ({
  hostCount,
  hostLabel = '{count,number} {count, plural, one {Host} other {Hosts}}',
  hostsDescription = 'Will be upgraded one at a time during Cluster upgrade'
}) => {
  const hostLabelFormat = new Format(hostsLabel)
  return (
    <div className='clusterUpgradeWizard-UpgradeReview'>
      <Card>
        <Card.Title>
          <Icon type='pf' name='container-node' className='circle-icon' />
          <div className='info-label'>
            { hostLabelFormat.format({ count: hostCount }) }
          </div>
        </Card.Title>
        <Card.Body>
          { hostsDescription }
        </Card.Body>
      </Card>
    </div>
  )
}
UpgradeReview.propTypes = {
  hostCount: PropTypes.number.isRequired,
  hostLabel: PropTypes.string,
  hostsDescription: PropTypes.string
}
export default UpgradeReview

The reason it breaks due to a change in #2190 that moved the sub components from Card.js to the peer index.js. It is the only component that looks like this.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


Back | FazBrowse Home | New Git URL