How to read and write a to a local file in Reactjs

React (typically) runs in the browser, but the file you are talking about lives on the server. So no, not just like that. You'd need to create some sort of API to send the data to the browser and back.