If I create a react app, and in this app there's a link to a local html file, once this app published on gh-pages, for some reasons said link doesn't lead anywhere, it just redirect the user on the same page he was in before clicking the link .
For exemple:
If I create a simple app with CRA like so :
App.js
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class App extends Component {
render() {
return (
<div className="App">
I'm the homepage
<a id='testlink' href='html2.html'> Go to the second page </a>
</div>
);
}
}
export default App;
And in the public folder I create a new html file "html2.html" that simply says
I am the second app !
And that's all, a simple app supposed to jump from index.html to html2.html when a link is clicked. Well this app works fine when tested with npm start, it works fine if launched via the static html file provided with npm run build, but when deployed on gh-pages, suddendly the link does not lead anywhere.
Here is the app described above deployed on ghpages
One workaround this problem would be to upload all the apps separately on gh-pages, or to use react router, but I wanted to know if I was just missing something. Thanks for your help.