Developer advocate, full-stack engineer, startup co-founder & CTO, bringing 15 years of experience in Silicon Valley, including at Google and Yahoo!. Public speaker.
Location
๐
Education
UC Santa Cruz Extension
Work
Developer Advocate at Weaviate, the open-source semantic search engine
If I'm understanding correctly, location is provided to "page" components, whereas this is a functional component/hook combo for flexibility in accessing this information.
The main reason for the additional install is this came from a project using Typescript so it needed to be explicitly defined in the package to avoid linting errors/leverage intellisense.
But thanks for bringing that to my attention, I'm sure it would be useful in other scenarios!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Is it necessary to
useLocation
? Gatsby passes location via props to any component.If I'm understanding correctly,
location
is provided to "page" components, whereas this is a functional component/hook combo for flexibility in accessing this information.The main reason for the additional install is this came from a project using Typescript so it needed to be explicitly defined in the
package
to avoid linting errors/leverage intellisense.But thanks for bringing that to my attention, I'm sure it would be useful in other scenarios!