Introduction to React Js

4 33
Avatar for yara
Written by
3 years ago

React.js is an open-source JavaScript library for building user interfaces or UI components. before you start learning react you should have knowledge in html, css and JavaScript. Hence react is used to manipulate html and css just like JavaScript, and here opens a question?

why use react?

we use react for couple of reasons first react is fast. second react uses components which is easy to reuse in your code late and third it's efficient way using declarative code is just beautiful.

SO, let's start by making our first hello world App. I will use an online IDE for now called fiddlejs

step one: open fiddlejs

step two: choose react

step three: now let's render a hello world from react. how to do that?

ReactDOM.render(<h1>hello world!</h1>,document.getElementById("app"))

ReactDOM.render helps you render any html in the place you choose for example you will be having a div with an id app that you want it to have an h1 that displays helloworld the code goes like this

ReactDOM.render(WHAT YOU WANT TO RENDER,WHERE YOU WANT TO RENDER IT))

14
$ 0.36
$ 0.36 from @TheRandomRewarder
Avatar for yara
Written by
3 years ago

Comments

That was short... Lol I was expecting more that just that in the sense that nothing is explained really...

$ 0.00
3 years ago

yeah, I'm not expecting people here to read it honestly. I updated it for you

$ 0.00
3 years ago

Well you should because some people will. I did! As a front end developer I will need to get into React Native soon so I was happy to see an article on the topic. I was expecting that it would explain more.

I know it is a function that is getting an element from the DOM by its ID to put up a header tag line with H1... :P

Anyway if you post good stuff about programming I will be back to read it for sure.

$ 0.50
3 years ago

you gave me some hope that some people will read it instead of typing good article and that's it

$ 0.00
3 years ago