Why Can’t I Open My React App By Clicking Index.html?
A Mystery Resolved
Recently, a company I’ve been interviewing with asked me to create an app for them which would satisfy the following criteria.
Use the New York Times API
Present the latest 10 news stories about a topic.
When a story is clicked, produce a small summary and a link to the article.
[…]
Make the application adaptive, so that it can be both mobile and desktop friendly.
The app should Run when you open up your index.html file
Naturally, React seemed like the tool for the job, and I completed the task set with relatively few bumps along the way.
(Note: If you’re curious to check my app out- it’s available here https://infallible-tesla-146517.netlify.com/)
However, there was one problem- when I clicked on my index.html file, all I saw in the browser was a blank screen! In the past, I had always assumed that when you npm run build
Webpack pulled everything into the resultant index.html
file. Clearly, I had something to learn here.
Create-React-App
So I started speaking to other developers to try and get some advice. And, the feedback I…