How to use the react-hotkeys.withHotKeys 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 greena13 / react-hotkeys / examples / src / HOCWrappedNode.js View on Github external
opacity: 1,
      background: COLORS[colorNumber],
    };

    // tabIndex is explicitly set here so we can use the tab key to move between nodes
    // - by default we would set it to -1 so it can only be directly clicked (& tapped?)
    //   or focused programattically
    return (
      <div style="{style}" tabindex="0">
        [Alt+C] Change Color
      </div>
    );
  }
}

export default withHotKeys(ACTION_KEY_MAP)(HOCWrappedNode);

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