Back to articles
Why react is called single page application?

Why react is called single page application?

via Dev.to ReactArul .A

React is called a Single Page Application because it loads a single HTML page and dynamically updates the UI using client-side rendering and virtual DOM without reloading the entire page. images.openai.com Why React is SPA (core reason) React uses Client-Side Rendering (CSR) Browser loads: index.html JavaScript bundle After that β†’ React controls everything πŸ‘‰ No need to request a new HTML page from server every time Virtual DOM (the real engine) React doesn’t touch the real DOM directly every time. Instead: Creates a Virtual DOM Compares old vs new (diffing) Updates only the changed parts πŸ‘‰ This is why it feels fast and no reload happens Routing without reload (important) Libraries like: react-router-dom They change the URL, but: Do NOT reload the page Just swap components Example: < Route path = "/about" element = { < About /> } /> πŸ‘‰ Clicking /about does NOT fetch a new page πŸ‘‰ It just renders inside the same page

Continue reading on Dev.to React

Opens in a new tab

Read Full Article
7 views

Related Articles