I have a problem since two days; I want read a local JSON from my public folder on my React application created with react-app. mato.json (my .JSON file) src. When you fetch the file, you will just get the contents of the file as a string so you will have JSON.parse it. Refresh the page, check Medium 's site status, or find. The create-react-app build tool only processes the src/ directory, so for example your JavaScript outside of here will not be transpiled by Babel. Access files in public directory after production (create-react-app) EDIT: I was totally wrong. "react download file from folder" Code Answer's react js download file javascript by Tarik on Dec 29 2020 Donate Comment 5 xxxxxxxxxx 1 fetch('https://cors-anywhere.herokuapp.com/' + fileURL, { 2 method: 'GET', 3 headers: { 4 'Content-Type': 'application/pdf', 5 }, 6 }) 7 .then( (response) => response.blob()) 8 .then( (blob) => { 9 10 Step 2: Once you have your project setup, run the following command to install the papa parse package. Read this first ! But beware, the feature exists for a reason. T want to be processed by webpack a folder called public in the root of your React to! - ReactJS and images in public folder the gfg.png file ReactJS and images in the public - Javascript file from the config folder of your Laravel installation x27 ; s on session expires to images! Basically, it's an HTML template. In react component, Create state property to hold employee json file Inside the componentDidMount () callback method, use fetch to access the json local file and read json content and update state property with json content. The public folder is useful as a workaround for a number of less common cases: Note that if you add a