React-autosuggest: How do I import 'AutosuggestHighlightMatch' and 'AutosuggestHighlightParse'?

Created on 6 Nov 2017  路  6Comments  路  Source: moroshko/react-autosuggest

I try to implement suggestions with highlight using example from here https://codepen.io/moroshko/pen/PZWbzK?editors=0010

If you take a look at the code you will find the usage of 'AutosuggestHighlightMatch' and 'AutosuggestHighlightParse'.

I don't understand how to import them. Could you help me, please?

Most helpful comment

The example could state that it's including a 3rd party...

All 6 comments

You need to include autosuggest-highlight.

(If you inspect the JavaScript files that are included in this Codepen, you'll see that it uses autosuggest-highlight.)

@moroshko it does work. Thank you for help.
I think the issue can be closed.

It was a lot of help.
Thanks!

Having the same problem

import { AutosuggestHighlightMatch, AutosuggestHighlightParse } from 'autosuggest-highlight'

Results in

Module not found: Can't resolve 'autosuggest-highlight'

What's the correct way to include it. @moroshko I don't see where the files are included in the related CodePen:

image

from https://codepen.io/moroshko/pen/OpPqxY

ok I got it

import AutosuggestHighlightMatch from 'autosuggest-highlight/match'
import AutosuggestHighlightParse from 'autosuggest-highlight/parse'

The example could state that it's including a 3rd party...

Was this page helpful?
0 / 5 - 0 ratings