Today, I revised some of the core fundamentals of React JS. Sharing my simple notes here for anyone starting out with React:
1. SPA (Single Page Application):
React apps load a single HTML page and dynamically update the content, making the app super fast and smooth!
2. JSX (JavaScript XML):
It lets us write HTML and XML-like syntax directly inside JavaScript.
3. Running the App:
Use the simple command npm run dev to start your development server.
4. useState Hook:
Used to manage state (data) in functional components.
Syntax: const [variable, function] = useState(initialValue);
Example: const [count, setCount] = useState(0);
5. rfce Shortcut:
A handy shortcut in VS Code to quickly generate a React Functional Component Skeleton!