React - Function Component

1 - About

This page is about the writing of component with the functional syntax

3 - Syntax


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

4 - Example

  • A UD DOM component defining the Welcome tag

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

  • A React element using this DOM tag

const element = <Welcome name="Sarah Connor" />;

  • Rendering

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

  • The standard mandatory “root” DOM node (placeholder for React DOM manipulation)

<div id="root"></div>

  • Output:

5 - Management

5.1 - Loop

5.2 - Update


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap