iansinnott / iansinnott/react-string-replace

Support for running a callback for non-matches

Đang mở
#23 7 bình luận 1 reaction 0 người được giao Xem trên GitHub
discussion enhancement help wanted
Ngôn ngữ chính
JavaScript
Star
666
Fork
54
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.