What is the major difference in React (web app) and PHP being not a web app - or how do I decide what to use

#ELI5

  • prtm
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    The main difference is PHP is server side and react is client side. So with PHP the webpage gets rendered as HTML on the server side and that HTML gets sent to the client who displays it to the user. With react the server will have a home page with some basic HTML and the react app that get sent to the client. The react app will make API requests to the server to obtain the information needed to render the page on the client side.

    There are pros and cons to each. The main pro of react compared to PHP is that it’s easier to make interactive apps that update a small component on the screen instead of refreshing the entire window. You can still do that with PHP websites as well using JavaScript though. The main pros of server side rendering is that it is easier for search engines to index your webpage and the user experience of the website will be less dependent on how fast the client is.