iansinnott / iansinnott/react-string-replace

Support for running a callback for non-matches

オープン
#23 コメント 7 件 リアクション 1 件 担当者 0 名 GitHub で見る
discussion enhancement help wanted
主要言語
JavaScript
スター
666
フォーク
54
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。