How do I get the current url in Gatsby?

You can get the current url using the location prop from the @reach/router Location component. import PropTypes from ‘prop-types’; import React, { Component } from ‘react’; import { Location } from ‘@reach/router’; class SomeComponent extends Component { static propTypes = { location: PropTypes.object.isRequired } render() { const { location } = this.props; return <div>{JSON.stringify(location)}</div>; } … Read more

GatsbyJs client only paths goes to 404 page when the url is directly accessed in browser in “production”

The Why While the client-side router knows about this path, there is no corresponding HTML file. When the browser looks at the site it first loads the 404.html file generated by gatsby, which includes the client-side router. Once the router completes its initialization it reads the path and loads the correct page. Meaning you end … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)