Closed jackgardner closed 7 years ago
Hi ! thanks for the PR !
Maybe it can be better to have the componentRestrictions props to equal an object like https://developers.google.com/maps/documentation/javascript/reference#GeocoderComponentRestrictions ?
I will add keyword-spacing rule in eslint to have a consistent spacing.
Hi,
getPlacePredictions accepts a different object, limited to country only: (unless I am misreading the docs)
https://developers.google.com/maps/documentation/javascript/reference#ComponentRestrictions
It might be clearer if the componentRestrictions prop reflects this type though, so instead of
restrictions: PropTypes.oneOfType([
PropTypes.string,
PropTypes.arrayOf(PropTypes.string)
])
it could be
restrictions: PropTypes.shape({
country: PropTypes.oneOfType([
PropTypes.string,
PropTypes.arrayOf(PropTypes.string)
])
})
What do you think?
Yes ok, I miss the part where getPlacePredictions only accept country ^^
Agreed with
restrictions: PropTypes.shape({
country: PropTypes.oneOfType([
PropTypes.string,
PropTypes.arrayOf(PropTypes.string)
])
})
:)
Great - let me know what you think
Thanks !
Hi, sometimes it is useful to use ComponentRestrictions to restrict the place predictions API to certain countries. This PR will allow ComponentRestrictions to be passed through props on the component.
I also noticed there were a few inconsistencies with the linting etc and have included those as part of this PR in a seperate commit as they are only small, just let me know if you would like a seperate PR for those.