Reputation: 247
I am trying to create an app that will take source and destination location from the autocomplete box and the map shows the route between the two points:
I have used the two useState to store the value for Source and Destination. After that, I am passing those two values as props to my Routing component. But the problem is that in my Routing component I am receiving the props data for destination as 'undefined'.
Please find my sandbox code here.
Note: In above code for now I have directly set the coordinates for Destination.
I am not able to figure out why it is behaving this way. Is there a way to achieve this?
Upvotes: 0
Views: 1000