Bug: What is the current behavior?
1) Set attributeName on <Highlight /> to an array
Uncaught TypeError: Cannot read property 'split' of undefined
at parseHighlightedAttribute (highlight.js:62)
at parseAlgoliaHit (highlight.js:45)
at highlight (connectHighlight.js:25)
at Highlighter (Highlighter.js:25)
at mountIndeterminateComponent (react-dom.development.js:8058)
at beginWork (react-dom.development.js:8249)
at performUnitOfWork (react-dom.development.js:10244)
at workLoop (react-dom.development.js:10308)
at HTMLUnknownElement.callCallback (react-dom.development.js:540)
at Object.invokeGuardedCallbackDev (react-dom.development.js:579)
Bug: What is the expected behavior?
It should render a list highlighted values
N.B. I've hacked a P.O.C for this, happy to share if you think it could be useful
The Highlight component take a hit and the path to the attribute name present on the hit. When you want to highlight multiple attributes on the hit you can use multiple Highlight components.
Can you share a bit more of the use case? Maybe I miss something.
thanks @therealwebby, would love to see that POC!
closing for now because it's a duplicate of #22
@Haroenv not sure that is the same request. The issue you reference is for highlighting an array present on the records instead of a single value. In this case the props remains the same.
But in this one it's question about passing an array to the attribute name, I think it's a different topic.
Aha, that's right, it's indeed something else. However I think it makes more sense to use multiple Highlight components indeed
Does this needs to be reopened then?
Nope I don't think so. Passing an array to attributeName don't make sense to me. If you want to highlight multiple attributes you could use multiple <Highlight /> component.
The use case for highlighting an array of values on the records is tracked on an this issue #22.
Most helpful comment
The
Highlightcomponent take a hit and the path to the attribute name present on the hit. When you want to highlight multiple attributes on the hit you can use multipleHighlightcomponents.Can you share a bit more of the use case? Maybe I miss something.