I have a react app, which i make thought create-react-app. I want to make here a link, that will refer to project.html file. I tried to make something like this:
const Portfolio = (props) => {
return (
<a href="../projects/project.html" target="_blank">
<button>Go to this project</button>
</a>
)
}
But this lead me to http://localhost:3000/projects/project.html and react app. I also tried to import this path like:
import html from "../projects/project.html"
and then to do something like this:
<a href={html} target="_blank">
<button>Go to this project</button>
</a>
but react say that i need some loader for this. I find that there are html-loader, i install it by npm install --save-dev html-loader
and add configuration to webpack.config.js but nothing changed
If your
projects/project.html
file contains only static content and does not require anything from the codebase, you could move theprojects
folder to thepublic
folder, and link to that file in your React component with: