How to use the react-hotkeys.HotKeys function in react-hotkeys

To help you get started, we’ve selected a few react-hotkeys 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 s-panferov / tygen / packages / docscript-react / ignore / explorer / components / hotkeys.ts View on Github external
import * as React from 'react'

export interface HotkeysProps extends React.CommonProps {
	keyMap?: any
	handlers?: { [command: string]: () => void }
}

let hotkeys = require('react-hotkeys')
let Hotkeys: React.ReactCtor = hotkeys.HotKeys
export default Hotkeys
github WTTJ / react-jungle-select / dist / JungleSelect.js View on Github external
focused = _state4.focused;

      var selected = this.selectedItems();

      var classNames = ['jungle-select'].concat(className);
      this.listOpened() && classNames.push('jungle-select-opened');
      selected.length && classNames.push('jungle-select-selected');
      filter && filter.length && classNames.push('jungle-select-filtered');
      focused && classNames.push('jungle-select-focused');
      if (classList) {
        classNames = classNames.concat(classList);
      }
      mode && classNames.push('mode-' + mode);

      return _react2.default.createElement(
        _reactHotkeys.HotKeys,
        {
          ref: function ref(e) {
            return _this7.container = e;
          },
          keyMap: keyMap,
          handlers: handlers,
          focused: true,
          className: classNames.join(' '),
          onFocus: this.onFocusFilter.bind(this)
        },
        _react2.default.createElement(
          'div',
          null,
          _react2.default.createElement(
            'div',
            { className: 'jungle-select-controls' },

react-hotkeys

A declarative library for handling hotkeys and focus within a React application

ISC
Latest version published 5 years ago

Package Health Score

59 / 100
Full package analysis