[英]OnSelect dosnt work with react-Google-places-autocomplete
I build a form with react js and i want to include location with google-auto complete , so i found this library :我用 react js 构建了一个表单,我想用 google-auto complete 包含位置,所以我找到了这个库:
https://github.com/Tintef/react-google-places-autocomplete#readme https://github.com/Tintef/react-google-places-autocomplete#readme
Its worked fine for me for 2 weeks but suddenly I see nothing while I print the value of OnSelect.它对我来说很好用了 2 周,但是在我打印 OnSelect 的值时突然什么也没看到。 at my console this message in yellow pops-up:
在我的控制台中,此消息以黄色弹出:
Select-073d29ba.esm.js:749 [Violation] Added non-passive event listener to a scroll-blocking 'wheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
my Component:我的组件:
<div>
<GooglePlacesAutocomplete
onSelect={console.log}
/>
Suggestion what happend?建议怎么回事?
I was facing the same issue, the problem is that the latest version of react-google-places-autocomplete is still in ALPHA and BETA Testing and it is not a stable one.我遇到了同样的问题,问题是最新版本的 react-google-places-autocomplete 仍在 ALPHA 和 BETA 测试中,它不是一个稳定的版本。
Just use the version 2.3.2, it will solve the issue.只需使用2.3.2版本即可解决问题。
run the command :运行命令:
npm install --save react-google-places-autocomplete@2.3.2
npm install --save react-google-places-autocomplete@2.3.2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.