concept new db.json file in category react

appears as: new db.json file
React Hooks in Action

This is an excerpt from Manning's book React Hooks in Action.

So far in React Hooks in Action, we’ve been importing data for the bookings app example from the static.json file. But, it’s more common to fetch data from a server. To make our examples a little more realistic, let’s start doing just that. Rather than reach out to a public server, we run a JSON server locally, using a new db.json file outside of the src folder. We then create a component that fetches data from that server. We cover:

  • Creating the new db.json file.