Let’s Start a Journey With React

Getting Started With React

Now Discuss some features about React.

Components

function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}

const element = <Welcome name="Hasibul Islam" />;
ReactDOM.render(
element,
document.getElementById('root')
);

JSX

const myelement = <h1>I am Hasibul ISlam .I love to Code</h1>;

ReactDOM.render(myelement, document.getElementById('root'));

React hooks

import React, { useState } from 'react';

function Example() {
[count, setCount] = useState(0);
return (
<div>
<p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>
Click me
</button>
</div>
);
}

React router

function App() {
return (
<main>
<Switch>
<Route path="/" component={Home} exact />
<Route path="/about" component={About} />
<Route path="/shop" component={Shop} />
<Route component={Error} />
</Switch>
</main>
)
}

Web developer,programmer, writer,gamer