/load-json-react

Loading JSON data from an external file and render into React components

Primary LanguageJavaScript

How to load JSON data from a local file into React JS?

Use Case

Let's consider a data set in JSON format containing financial stocks of muliple companies. This project reads the data in JSON format from an external file and render on the web page in a tabular format as shown below.

Stock Tracker

How to run this project

  • Open your terminal and run these commands to get a sample Create React App running on your machine.

    yarn && yarn start
  • Now to run the app in the development mode,
    open http://localhost:3000 in the browser and you should see the sample app running.

Build and Deploy this Application

To build the app for production to the build folder.
use yarn build on your terminal inside the root of the project.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!