skip to Main Content

I’ve imported a React project from Github (link below) into my VS editor. It deploys fine to my browser. I can make edits in my .tsx files just fine.

But the text in my about.html page doesn’t appear in the localhost. What’s wrong?

fork: gh-pages-navigation.

original project:
https://github.com/white-lidded-red-teapot/white-lidded-red-teapot.github.io

I tried making sure sure that the links between the landing (index.html) page and the about.html page works fine. I wrote the navigation links in NavBar.tsx. The project seems to have no problem displaying about.html it just has a problem in displaying the text in it.

2

Answers


  1. Why do you want to have a page about.html?

    You already know the index.html file acts as the initial entry point for your React App when it’s serverd in a web browser. With this in mind it’s generraly not a good idea to create a file name about.html within the same directory as your React App’s index.html for several reasons.

    So you should created a dedicated React Component named About that renders the content for your About page. You can then include this compoment within your main app component using routing to navigate to this page.

    Login or Signup to reply.
  2. See its a good coding practice to keep only one .html file in the react app then why you are creating other html files and if you really want to add about in your app then make a react component with the name about.tsx and add that where ever you needed.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search