-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Labels
Description
I'd be extremely helpful to extract out the search logic into a separate export that can be used outside JSX code.
Problem
I have a text toggle component that shows/hides text. I also have a search box that can search for text. If I haven't toggled the text component and I search I still want to know the number of hits that a search would highlight. I can't easily do this now without duplicating logic between this component and my search component.
Solution
If we extract out the search logic into a separate export, I could generate my RE, do the search, get the number of hits, then when I toggle the text view, render Highlight with the same RE and I should have the same number of hits as I do highlights.
TimonVS, helior and ericgio