2

I am trying to route between pages in gatsby. It works in local host but sadly not in netlify.
The route link is My-site.com/about/ It doesn't work in netlify but when I reload the page the route become My-site.com/About/ and the page content shows.

In my index.js

function Home = () => {
  return (
       <Link to="/about/"> About Page </Link>
  );
};
export default Home;

In About.js

function About = () => {
  return (
      <h2> This is About page </h2>
  );
};
export default About
Tibebes. M
  • 6,940
  • 5
  • 15
  • 36
Subreena
  • 158
  • 1
  • 1
  • 10

1 Answers1

0

Your About.js file should be named about.js (lowercased). This is because with Gatsby, components under src/pages become pages automatically with paths based on their filename.

You can check Pages and Layout documentation for further information.

Ferran Buireu
  • 28,630
  • 6
  • 39
  • 67