⚠️_READ_THIS_FIRST.md

md1 kBIn Examples.zip

⚠️ READ THIS FIRST - How to View React Examples

❌ COMMON MISTAKE

DON'T double-click index.html files!

You will get this error:

❌ Access to script at 'file:///C:/assets/index-xxx.js' from origin 'null' 
   has been blocked by CORS policy

✅ CORRECT WAY

React apps MUST run on a web server.


NPM Development Server

Shell
# 1. Open terminal/command prompt
# 2. Navigate to any chapter:
cd Chapter01-Introduction

# 3. Install (first time only):
npm install

# 4. Start server:
npm run dev

# 5. Open browser to: http://localhost:5173

✅ Advantages: Hot reload, best for learning, see changes instantly


🎯 Quick Reference

What You Want Command URL
Learn & Code npm run dev http://localhost:5173
Quick Preview python -m http.server 8000 http://localhost:8000
Super Easy Double-click .bat file Opens automatically

📚 More Help

  • Detailed solutions: HOW_TO_VIEW_EXAMPLES.md
  • Full guide: START_ALL_EXAMPLES.md
  • General info: README.md

💡 Remember

🚫 Never use: file:// protocol (double-clicking files)
✅ Always use: http://localhost (web server)

React apps are web applications - they need a web server to run properly!

In Examples.zip

Chapter01-Introduction/6
src/4App.css3 kBApp.jsx4 kBindex.css1 kBmain.jsx1 kB
index.html1 kBpackage.json1 kBserve-dist.bat1 kBstart-dev-server.bat1 kBvite.config.js1 kB
Chapter02-GettingStarted/5
public/1index.html1 kB
src/4App.css1 kBApp.jsx2 kBindex.css1 kBmain.jsx1 kB
index.html1 kBpackage.json1 kBvite.config.js1 kB
Chapter03-JSX/5
public/1index.html1 kB
src/4App.css1 kBApp.jsx5 kBindex.css1 kBmain.jsx1 kB
index.html1 kBpackage.json1 kBvite.config.js1 kB
Chapter04-Components/5
public/1index.html1 kB
src/5
components/3Card.jsx1 kBFooter.jsx1 kBHeader.jsx1 kB
App.css1 kBApp.jsx4 kBindex.css1 kBmain.jsx1 kB
index.html1 kBpackage.json1 kBvite.config.js1 kB
Chapter05-Props/5
public/1index.html1 kB
src/4App.css1 kBApp.jsx7 kBindex.css1 kBmain.jsx1 kB
index.html1 kBpackage.json1 kBvite.config.js1 kB
Chapter06-Events/4
src/4App.css1 kBApp.jsx10 kBindex.css1 kBmain.jsx1 kB
index.html1 kBpackage.json1 kBvite.config.js1 kB
Chapter06-State/3
public/1index.html1 kB
src/4App.css3 kBApp.js5 kBindex.css1 kBindex.js1 kB
package.json1 kB
Chapter07-Hooks/5
public/1index.html1 kB
src/4App.css1 kBApp.jsx8 kBindex.css1 kBmain.jsx1 kB
index.html1 kBpackage.json1 kBvite.config.js1 kB
Chapter08-Conditional/4
src/4App.css1 kBApp.jsx11 kBindex.css1 kBmain.jsx1 kB
index.html1 kBpackage.json1 kBvite.config.js1 kB
Chapter08-Events/3
public/1index.html1 kB
src/4App.css3 kBApp.js7 kBindex.css1 kBindex.js1 kB
package.json1 kB
Chapter09-Forms/5
public/1index.html1 kB
src/4App.css1 kBApp.jsx12 kBindex.css1 kBmain.jsx1 kB
index.html1 kBpackage.json1 kBvite.config.js1 kB
Chapter10-Router/5
public/1index.html1 kB
src/5App.css1 kBApp.js6 kBindex.css1 kBindex.js1 kBmain.jsx1 kB
index.html1 kBpackage.json1 kBvite.config.js1 kB
Chapter11-Styling/5
public/1index.html1 kB
src/6App.css3 kBApp.js5 kBButton.module.css1 kBindex.css1 kBindex.js1 kBmain.jsx1 kB
index.html1 kBpackage.json1 kBvite.config.js1 kB
Chapter12-UseEffect/5
public/1index.html1 kB
src/5App.css2 kBApp.js7 kBindex.css1 kBindex.js1 kBmain.jsx1 kB
index.html1 kBpackage.json1 kBvite.config.js1 kB
Chapter13-UseContext/5
public/1index.html1 kB
src/5App.css3 kBApp.js7 kBindex.css1 kBindex.js1 kBmain.jsx1 kB
index.html1 kBpackage.json1 kBvite.config.js1 kB
Chapter14-UseRef/5
public/1index.html1 kB
src/5App.css3 kBApp.js7 kBindex.css1 kBindex.js1 kBmain.jsx1 kB
index.html1 kBpackage.json1 kBvite.config.js1 kB
Chapter15-CustomHooks/5
public/1index.html1 kB
src/5App.css3 kBApp.js8 kBindex.css1 kBindex.js1 kBmain.jsx1 kB
index.html1 kBpackage.json1 kBvite.config.js1 kB
⚠️_READ_THIS_FIRST.md1 kBINSTALLATION_GUIDE.md6 kBVITE_GUIDE.md8 kB