Closed rls200 closed 4 years ago
@razhihan11 like so:
import React from "react";
import ReactDOM from "react-dom";
import { YMaps, Map } from "react-yandex-maps";
import "./styles.css";
function App() {
const loadSuggest = ymaps => {
const suggestView = new ymaps.SuggestView("suggest");
};
return (
<div className="App">
<input type="text" className="form-control" id="suggest" />
<YMaps>
<Map
onLoad={ymaps => loadSuggest(ymaps)}
defaultState={{ center: [55.751574, 37.573856], zoom: 9 }}
modules={["SuggestView"]}
/>
</YMaps>
</div>
);
}
const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);
@mmarkelov Thanks very much, but it's possible hide map? I need only suggest
UPD. And when i type , how get data for this address( Position e.t.c)
Suggest How can I implement this functionality in React. A simple example with input to offer hints when entering an address