Under the Hood of React Components
internet

Under the Hood of React Components

Doing It The JSX Way

Components are the building blocks of react websites and UIs and these components are built using Java script XML(extended markup language). I was confused when I first looked at the code in the begining, it was html code being embedded in java-script code.

import React from 'react'

const Header = () => {

return (

<div className='container'>

<h1>Under the Hood</h1>

</div>

)}

export default Header

Doing It The Native JS Way

import React from 'react'

const Header = () => {

return React.createElement('div',{className:'container'},

React.createElement('h1',{},'Under the Hood'))

}

export default Header

Just image the whole website using the JS way, this would need so many lines of code, the JSX way is easier and manageable. But, when we write code using the JSX way, the JS way is what happens under the hood. For further reading, check https://reactjs.org/docs/introducing-jsx.html.

要查看或添加评论,请登录

Alois Napitalai的更多文章

  • Using the Terminal in Ubuntu Server

    Using the Terminal in Ubuntu Server

    A graphical User Interface(GUI) makes it easy for us to navigate and do work especially in the Ubuntu desktop version…

    3 条评论
  • Logistic Regression

    Logistic Regression

    This is a follow up tutorial on my previous post linear regression on my road to understanding machine learning. As a…

    8 条评论
  • Road to Understanding Machine Learning

    Road to Understanding Machine Learning

    Traditional Machine Learning-Linear Regression Algorithm Machine learning is simply training a machine to make…

  • Automate a Full-stack Application Deployment Using GitHub Actions

    Automate a Full-stack Application Deployment Using GitHub Actions

    #githubactions #git #reactjs #expressjs #virtualization #fullstackdevelopment #githubrepository #statemanagement I have…

    2 条评论
  • Using Github Actions For Website Building

    Using Github Actions For Website Building

    name: Website Deployment Automation on: push jobs: installs: runs-on: ubuntu-latest…

    2 条评论
  • Excel Functions and Formulas

    Excel Functions and Formulas

    I got stuck on excel formulas and functions the other day, it took me some time to get what I wanted. I have a little…

  • React and Ionic Routing

    React and Ionic Routing

    React Routing What is routing in react? Routing in React is the process of mapping URLs(uniform resource locators) to…

  • Persisting GeoSpatial Data in MongoDB

    Persisting GeoSpatial Data in MongoDB

    Persisting data is crucial in web applications, if data is not saved, the data is wiped out when a page refresh is done…

  • Web Proxy Authentication

    Web Proxy Authentication

    In my last article, I wrote about the installation of squid as a caching server that can be used to locally cache pages…

    7 条评论
  • Squid Cache Web Proxy

    Squid Cache Web Proxy

    Many computer networks tend to crawl when there are many users accessing the internet, or there are unwanted traffic…

    4 条评论

社区洞察

其他会员也浏览了