react-places-autocomplete
react-places-autocomplete copied to clipboard
error when using getInputProps
In my component I get the following error when attempting to use getInputProps,
Module build failed (from ./node_modules/next/dist/build/webpack/loaders/next-babel-loader.js):
TypeError: Cannot read property '0' of null
I'm using Next.js. I have the places library loaded in my project. I copied much of the documentation's code. I'm not sure why this method is giving me an error.
Any help is appreciated.
The problem lies with next.js but is relevant when using this library.
https://github.com/zeit/styled-jsx/issues/539 https://github.com/zeit/next.js/issues/6057
The spread syntax operator is the issue. Removing the styled jsx tags solves the issue.
I ended up creating a separate component to quarantine the input element. I styled this component elsewhere in the project using global tags.