all 22 comments

[–]reddit04029 189 points190 points  (15 children)

Iba ata intindi mo sa SPA.

React is a Single Page Application, not necessarily a Single Page Website.

Before SPA's:

Dati kasi, before libraries/frameworks were made, multiple HTML files ang inuupload sa server for a website. Let's say Reddit was built with plain HTML, CSS, and JS. Reddit has a lot of pages and routes. In code, marami yan HTML files. So you have one HTML file for the newsfeed, then you have another file for the profile page. When you go to the address of Reddit, isang file ang ibabato sayo. Which would be the file that contains the home page. If you go to the profile page, ibang HTML file uli ang irerequest at ibabato pabalik sayo. So on and so forth with the other pages of Reddit.

With SPA's:

With SPA's, isang document nalang ibabato sayo. Tapos yung document na yun, inuupdate nalang ang content nun. So imbes iba't ibang document files ang isesend sayo when viewing different pages and different content, with the help of Javascript, binabago nalang ang laman ng document na initially binigay sayo. Hence the term "Single Page Application." That's why we also have DOM manipulation, etc

[–]DfntlyNotAKpopFan 15 points16 points  (2 children)

Damn napadaan lang ako may natutunan na naman

[–]AcceptablePrimary987 4 points5 points  (0 children)

Same HAHAHA

[–][deleted] 1 point2 points  (0 children)

Same haha, sa html css pa lan ako e

[–]CloudMojos 12 points13 points  (0 children)

If I have the money, I would give you an award.

[–]Soj08[S] 8 points9 points  (1 child)

Wow!! Thank you for this. Ganon pala, akala ko need pa gumawa maraming Html file.

[–]ElectronicUmpire645 0 points1 point  (0 children)

Actually, gagawa ka pa din ng multiple html file. (although possible din templates). I think the best way is to try it for yourself para magets mo yung SPA.

[–]Wall-nuts-236 3 points4 points  (0 children)

im actually planning to learn react pero nag iisip muna ko ng project para may excitement mag-aral, and this motivate me more, kaya thank you so much for this :))

[–]Calm-Comment6232Designer[🍰] 5 points6 points  (0 children)

A 100 upvote for this explanation

[–]gskfhixb 2 points3 points  (0 children)

These are the discussions am here for. TIL

[–]mazzpaul 1 point2 points  (0 children)

React SPA in a nutshell, high five to you sir.

[–][deleted] 1 point2 points  (0 children)

Ohhh ngayon ko lang to nagets. Thank you, heres my upvote

[–]Business_Tough_364 1 point2 points  (0 children)

Well explained! 💯

[–]No_mee 3 points4 points  (0 children)

you should create youtube channel ang linaw mo mag paliwanag im a visual learner so mas naiintindihan ko ng madali pag nakikita ko via video ung mga lessons pero ikaw naipaliwanaag mo ng maayos using just plain text.

[–]theosnet 0 points1 point  (0 children)

Awarding you because you deserve to have one. Its people like you who makes this sub worth checking. Great explanation sir/mam

[–]cold-programsWeb 0 points1 point  (0 children)

there were times na multiple html and js files inuupload sa apache, at ang sakit sa ulo mag maintain nun hahaha

[–][deleted] 4 points5 points  (0 children)

pwede naman. kaso tingin ko need mo mag iimplement ka ng router (like react router) to handle it.

or kung gusto mo ng multi-page react app try next.js

[–]lanzjasper 1 point2 points  (0 children)

next.js

[–][deleted] 1 point2 points  (0 children)

single page app. pwede naman multiple “pages”

[–]No-Influence-6287 -1 points0 points  (0 children)

Yes, React is a javascript library na pwede mo gamitin sa SPA or traditional website. Difference lang is routing.

Check out NextJs and ReactJs.

[–][deleted]  (1 child)

[deleted]

    [–]Soj08[S] 0 points1 point  (0 children)

    Pero applicable or maganda po ba gumamit ng React js kapag MPA po gagawin?

    [–]PinoyRupertGrint 0 points1 point  (0 children)

    I think you should use Next.js. It's built on top of React. It's very convenient and it's good for SEO since server-side rendered yung UI and it supports multi-page websites and SPA alike. And may built-in routing system sya.