Navigate back to the homepage

React Intro

Muhamed Gaber, 
March 2nd, 2020 · 1 min read

still work in progress

Hello, world! This is my first blog post, it’s going to be about React.

React is a JavaScript library for building user interfaces.

Why would you bother knowing about React, after all there is a tone of other libraries and frameworks that are doing the same job, right!. now quite right, React is the most popular option out there for building modern SPA in JavaScript, and the reason for that is not just it’s simplicity but also it’s power.

React approach of building UI

  • Declarative: by only designing how the view should look like you are ready to go, React will take care of updating and rendering the right component when your data changes.
  • Component Based: your design of the view is encapsulated in reusable components that can manage their own state, then you can compose these components and build more compoex view.

Functional component example

1import React from 'react'
2import ReactDOM from 'react-dom'
3
4const Greeting = () => {
5 return (
6 <h1>hi there</h1>
7 )
8}
9
10ReactDom.render(<Greeting />, document.getElementById('root'))
© 2020 Muhamed Gaber
Link to $https://twitter.com/Mu_GaberLink to $https://github.com/MuGaberLink to $https://www.linkedin.com/in/muhamed-gaber/