ScanSkill

Functional Component

A functional component is a javascript function that may or may not receive props as an argument and returns the element that needs to be rendered. It is also known as a stateless component because it does not have its own state.

Syntax

const ComponentName=()=>
{
    return (
        // JSX goes here
    );
}

Example

import React from 'react'

function MyComponent() {
  return (
    <div>Hello World!</div>
  )
}

export default MyComponent
Functional Component