18
loading...
This website collects cookies to deliver better user experience
import React from "react"
import ReactDom from "react-dom"
ReactDom.render(
<ul>
<li>eat</li>
<li>sleep</li>
<li>code</li>
</ul>
,document.getElementById("root")
)
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="root"></div>
<script src="index.pack.js"></script>
</body>
</html>
import React from "react"
import ReactDom from "react-dom"
//function
function App()
{
return (<ul>
<li>eat</li>
<li>sleep</li>
<li>code</li>
</ul>)
}
ReactDom.render(<App />,document.getElementById("root"))
import React from "react"
function App(){
return (
<div>
<h1>Umapathi K.</h1>
<p>I am the student who loves...</p>
<ol>
<li>Running</li>
<li>Coding</li>
<li>Pubg</li>
</ol>
</div>)
}
export default App
import React from "react"
import ReactDom from "react-dom"
import App from "./App"
ReactDom.render(<App />,document.getElementById("root"))
The best online code editor for React JS is stackblitz, It is very efficient for learning and building small projects, So, I recommend creating account on stackblitz for learning React JS
import React from "react";
import Tweet from "./components/Tweet";
function App(){
return(
<div className="tweet"> // class is keyword in js so we use className
<Tweet name="Umapathi" content="coding with 2gb ram😁" likes="2" />
<Tweet
name="madhavan"
content="finished my coding schedule😴"
likes="15667"
/>
<Tweet
name="Ajay"
content="I should have started learning recat early 😣"
likes="2487"
/>
</div>
);
}
export default App;
import React from "react";
function Tweet(props){
return (
<div>
<h1>{props.name}</h1>
<p>{props.content}</p>
<h3>{props.likes} likes</h3>
</div>
);
}
export default Tweet;
import React from "react";
function Tweet({name,content,likes}){
return (
<div>
<h1>{name}</h1>
<p>{content}</p>
<h3>{likes} likes</h3>
</div>
);
}
export default Tweet;