Posted On: Feb 22, 2018
Conceptually, components are like JavaScript functions. They accept arbitrary inputs (called “props”) and return React elements describing what should appear on the screen.
Below is ample component written in ES6 class to display a welcome message on the screen.
class Welcome extends React.Component { render() { return <h1>Hello, {this.props.name} </h1>; } } const element = <Welcome name="Sara" />; ReactDOM.render( element, document.getElementById('root') );
source: https://facebook.github.io/react/docs/components-and-props.html
Never Miss an Articles from us.
React js is javascript based UI Library developed at Facebook, to create an interactive, stateful & reusable UI com..
Advantages of React JsReact.js is extremely efficient: React.js creates its own virtual DOM where your components act..
JSX is an XML/HTML-like syntax used by React that extends ECMAScript so that XML/HTML-like text can co-exist with JavaS..