iansinnott / iansinnott/react-string-replace

Multiple matches on same string

Aperta
#35 2 commenti 6 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
666
Fork
54
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hi there, when using this twice on the same string what is happens is as follows, the first string matches and an array containing the react component returned from the callback fucktion is returned, and than in the second replace, it skips the symbol that was returned from the first run because it is not a string...
I think the solution would be to use flattenDeep instead of flatten, and clarify that callback functions should return an array instead of a component.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.