<commit_before># cloneReferencedElement for React Native

This is a version of `React.cloneElement` that preserves the original element's ref even if you specify a new ref for the clone.
<commit_msg>Add usage example to README<commit_after># cloneReferencedElement for React Native

This is a version of `React.cloneElement` that preserves the original element's ref even if you specify a new ref for the clone.

## Usage

The signature of `cloneReferencedElement` is the same as that of `React.cloneElement`. However, when using callback refs, it will preserve the ref on the original component if there is one.

```js
let element =
  <Component ref={component => {
    console.log('Running the original ref handler');
  }} />
cloneReferencedElement(element, {
  ref(component) {
    console.log('Running the clone ref handler');
  },
});
```

When the component is mounted, the console will display:
```
Running the clone ref handler
Running the original ref handler
```

{'fraction_non_alphanumeric': 0.07913669064748201, 'fraction_numerical': 0.0, 'mean_word_length': 4.729411764705882, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7601453', 'n_tokens_mistral': 261, 'n_tokens_neox': 250, 'n_words': 124}