<commit_before># React Focus Trap

A generic focus management tool for components such as dialogs and dropdowns.

## Usage

React Focus Trap is a container element that will manage focus for its children

```javascript
let Modal = React.createClass({

  render() {
    <FocusTrap onExit={ this._onExit }>
      Amazing stuff goes here
    </FocusTrap>
  }
})
```

When Focus Trap is active, it will do several things:

1. Ensure focus remains on its content
2. Exits when clicks outside of the container occur
3. Exists when the escape key is pressed

## Props

| Name       | Default              | Description                                           |
| ---------- | -------------------- | ----------------------------------------------------- |
| active     | false                | Should the FocusTrap render?                          |
| className  | 'focus-trap-inner'   | The class of the inner container that maintains focus |
| onExit     | null (but required)  | Callback when escape or an outside click occurs       |
| element    | 'div'                | The tag name of the inner container                   |<commit_msg>[update] Have a functional sample<commit_after># React Focus Trap

A generic focus management tool for components such as dialogs and dropdowns.

## Usage

React Focus Trap is a container element that will manage focus for its children

```javascript
let Modal = React.createClass({
  render() {
    return (
      <FocusTrap onExit={ this._onExit } active={ this.props.active }>
        Amazing stuff goes here
      </FocusTrap>
    )
  }
})
```

When Focus Trap is active, it will do several things:

1. Ensure focus remains on its content
2. Exits when clicks outside of the container occur
3. Exists when the escape key is pressed

## Props

| Name       | Default              | Description                                           |
| ---------- | -------------------- | ----------------------------------------------------- |
| active     | false                | Should the FocusTrap render?                          |
| className  | 'focus-trap-inner'   | The class of the inner container that maintains focus |
| onExit     | null (but required)  | Callback when escape or an outside click occurs       |
| element    | 'div'                | The tag name of the inner container                   |
{'fraction_non_alphanumeric': 0.13591819343843203, 'fraction_numerical': 0.0025564550489987218, 'mean_word_length': 1.6621315192743764, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6452597', 'n_tokens_mistral': 569, 'n_tokens_neox': 551, 'n_words': 247}