Skip to content

Commit 6d8ea03

Browse files
committed
[Fix][Ezra] Directions Docs Callback Fix
1 parent d6a84c8 commit 6d8ea03

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/react-google-maps-api/src/components/directions/DirectionsRenderer.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ class Directions extends Component {
2727
this.onMapClick = this.onMapClick.bind(this)
2828
}
2929

30-
directionsCallback (response) {
31-
console.log(response)
30+
directionsCallback (result, status) {
31+
console.log(result)
3232

33-
if (response !== null) {
34-
if (response.status === 'OK') {
33+
if (result !== null) {
34+
if (status === 'OK') {
3535
this.setState(
3636
() => ({
37-
response
37+
response: result
3838
})
3939
)
4040
} else {
41-
console.log('response: ', response)
41+
console.log('response: ', result)
4242
}
4343
}
4444
}
@@ -235,7 +235,7 @@ class Directions extends Component {
235235
}
236236

237237
{
238-
this.state.response !== null && (
238+
this.state.response && (
239239
<DirectionsRenderer
240240
// required
241241
options={{ // eslint-disable-line react-perf/jsx-no-new-object-as-prop

0 commit comments

Comments
 (0)