How to use the @instructure/ui-react-utils.hack function in @instructure/ui-react-utils

To help you get started, we’ve selected a few @instructure/ui-react-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github instructure / instructure-ui / packages / ui-elements / src / TruncateText / index.js View on Github external
import truncate from './utils/truncate'

import styles from './styles.css'
import theme from './theme'

/**
---
category: components/deprecated
id: DeprecatedTruncateText
---
**/
@deprecated('7.0.0', null, 'Use @instructure/ui-truncate-text instead.')
@testable()
@themeable(theme, styles)
@hack(['shouldTruncateWhenInvisible'])
class TruncateText extends Component {
  static propTypes = {
    /**
    * The content to be truncated.
    */
    children: PropTypes.node.isRequired,
    /**
    * Number of lines to allow before truncating. `auto` will fit to parent
    */
    maxLines: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
    /**
    * Where to place the ellipsis within the string
    */
    position: PropTypes.oneOf(['end', 'middle']),
    /**
    * Add ellipsis after words or after any character