Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update type definition for sessionToken in searchOptions prop #406

Open
greedybrain opened this issue Jun 15, 2023 · 0 comments
Open

Update type definition for sessionToken in searchOptions prop #406

greedybrain opened this issue Jun 15, 2023 · 0 comments

Comments

@greedybrain
Copy link

greedybrain commented Jun 15, 2023

Hello,

While using the react-places-autocomplete library, I've encountered an issue related to the sessionToken prop in the searchOptions object.

Currently, the type definition for sessionToken is expecting an instance of google.maps.places.AutocompleteSessionToken, as per the error message: "InvalidValueError: in property sessionToken: not an instance of AutocompleteSessionToken". However, according to the Google Places API documentation, a session token should be a random string that identifies an autocomplete session for billing purposes. Google's recommendation is to use a version 4 UUID for this purpose.

In my application, I've followed Google's recommendation and generated a UUID string for sessionToken, but I'm encountering type errors due to the current type definition.

I suggest updating the type definition for sessionToken in the searchOptions prop to accept a string, in accordance with Google's guidelines. This would help users of the library to adhere to Google's recommendation for handling session tokens and avoid unnecessary type errors.

Thank you for your attention to this matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant