iansinnott / iansinnott/react-string-replace

Support for running a callback for non-matches

Ouverte
#23 7 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
discussion enhancement help wanted
Langage dominant
JavaScript
Étoiles
666
Forks
54
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

A 4th parameter as callback to process non-match items would be useful.

For instance, in ReactNative, plain text cannot be outside of `` components. The non matches need to be wrapped in a component as well. A callback for these would come quite handy.

Example:
```
const matchCallback = (match, i) => ({match});
const nonMatchCallback = (nonmatch, i) => ({nonmatch});
const components = reactStringReplace(input, regex, matchCallback, nonMatchCallback);
```

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.