MII
MII

Reputation: 969

What should basically public folder contain in React

I was learning React and came across public folder which contains html file, favicon and the others. The question is for what public folder is actually created? and what should it contain?

Upvotes: 1

Views: 319

Answers (2)

Mohamad Shiralizadeh
Mohamad Shiralizadeh

Reputation: 8765

Just static contents that do not need to compile (.html, .svg, .jpg, ...).

Just like www folder for ASP.net Core projects.

But It is your desition to put them there or somewhere else.

Documentation

Upvotes: 2

fadeys.work
fadeys.work

Reputation: 499

React is a JavaScript library that needs to be "compiled" into code that the browser understands, so the public or build or dist folders are for holding the output of the compilation process or if you'd like, they store your artifact.

Just like target folder for Java projects.

Upvotes: 0

Related Questions