localvore-today / react-mapbox-autocomplete

MIT License
15 stars 17 forks source link

Doesn't work with nextJS #15

Open Florian-crg opened 3 years ago

Florian-crg commented 3 years ago

Just follow the doc with nextJS to reproduce the bug.

Here is my code

import MapboxAutocomplete from 'react-mapbox-autocomplete';

const Index = () => {
  const _suggestionSelect = (result, lat, lng, text) => {
    console.log(result, lat, lng, text)
  }
  return (
    <>
      <main className="container-fluid">
          <MapboxAutocomplete publicKey={process.env.NEXT_PUBLIC_MAPBOX_KEY}
            inputClass='form-control search'
            onSuggestionSelect={_suggestionSelect}
            country='us'
            resetSearch={false} />
      </main>
    </>
  )
}

And the error : /node_modules/react-mapbox-autocomplete/index.css:1 .react-mapbox-ac-menu { ^ SyntaxError: Unexpected token '.'

davecthomas commented 2 years ago

Same bug with Remix.run