iansinnott / iansinnott/react-string-replace

Support for running a callback for non-matches

Abierto
#23 7 comentarios 1 reacción 0 asignados Ver en GitHub
discussion enhancement help wanted
Lenguaje dominante
JavaScript
Estrellas
666
Forks
54
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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);
```

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.