Now that we have learned the fundamentals of javascript, it's time to learn how to rewrite our code in React. The basics of React is that what we would call a function is now called a component. Components names are capitalized. In React, we write code a lot simpler and create our elements from html all in react. With our components, when we hear the term render or rendering. It usually refers to us returning some code. Below, we have an example of what the difference of vanilla javascript and React is
Javascript -
function basicOf(){
const tool = document.createElement('div')
}
React
function BasicOf(){
return(
}
You can see that in React. You can use the div tag as if it was an html file.
Top comments (0)