How to use the @zendeskgarden/react-utilities.requiredParam function in @zendeskgarden/react-utilities

To help you get started, we’ve selected a few @zendeskgarden/react-utilities 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 zendeskgarden / react-components / packages / autocomplete / src / containers / AutocompleteContainer.js View on Github external
getTagProps = ({
    key = requiredParam('key'),
    id = this.getTagId(key),
    onMouseDown,
    onMouseUp,
    onClick,
    ...other
  }) => {
    const { tagFocusedKey } = this.getControlledState();
    const isFocusedItem = key === tagFocusedKey;
    const currentIndex = this.tagSelectionModel.numItems;

    this.tagIndexKeyMap[currentIndex] = key;

    if (isFocusedItem) {
      this.tagSelectionModel.selectedIndex = currentIndex;
    }
github zendeskgarden / react-components / packages / autocomplete / src / containers / AutocompleteContainer.js View on Github external
getItemProps = ({
    key = requiredParam('key'),
    id = this.getItemId(key),
    role = 'option',
    onClick,
    onMouseMove,
    index,
    ...other
  } = {}) => {
    const { focusedKey } = this.getControlledState();
    const isFocusedItem = key === focusedKey;
    const currentIndex = index === undefined ? this.focusSelectionModel.numItems : index;

    this.indexKeyMap[currentIndex] = key;

    if (isFocusedItem) {
      this.focusSelectionModel.selectedIndex = currentIndex;
    }

@zendeskgarden/react-utilities

Components relating to utilities in the Garden Design System

Apache-2.0
Latest version published 26 days ago

Package Health Score

81 / 100
Full package analysis