On this Day I Learned...

I learned about some basic items in React.JS

This day I learned how return statements work in react.

function Welcome(props) {
  return <h1>Welcome back!</h1>;
}

function GuestGreeting(props) {
  return <h1>Please sign up.</h1>;
}

For the above example, the return statement would work to return a single component for the webpage. However, to return more than just a heading a user will need to encapsulate the code in empty brackets as follows:

function Welcome(props) {
  return 
<> // These are empty brackets.
<h1>Welcome back!</h1>;
<h2>Where have you been</h2>
<>
}

function GuestGreeting(props) {
  return <h1>Please sign up.</h1>;
}

What makes React.JS easier to use?

React.JS boasts of the ability to create reusable components. I saw an example of where a programmer was able to isolate a specific component into a neighboring react file and then call it later into the specific page where they intended to use it.

For the people hoping to skip out on aspects of HTML code, you still have to create HTML code much like creating your page in Vanilla HTML. However, with React, you don't have to create a navbar on all of your pages you can simply call a component you need to use again. In addition to this, you don't have to actually spend a lot of time on the underlying code for items such as forms.