Static File Serving

Oreact can serve static files, like images, videos etc. under a folder called `public` in the root directory.

Public directory contains all the static front-end files used by the app to be served out. These static files can then referenced by your code starting from the base URL (/).


If you add an image to public/images/logo.png, the following code will access the image:

export default () => {
  return <img src="/images/logo.png" alt="Company logo" />

This folder is also useful for robots.txt, Google Site Verification, and any other static files (including .html)!

Note: Don't name the public directory anything else. The name cannot be changed and is the only directory used to serve static assets.