Answers for "function component example in react"

5

function component example in react

import React from 'react';

const Component = () => {
  return (
    <h1>Component</h1>
  )
}

export default Component;
Posted by: Guest on March-03-2022
2

functional components react

function Comment(props) {
  return (
    <div className="Comment">
      <div className="UserInfo">
        <img className="Avatar"
          src={props.author.avatarUrl}
          alt={props.author.name}
        />
        <div className="UserInfo-name">
          {props.author.name}
        </div>
      </div>
      <div className="Comment-text">
        {props.text}
      </div>
      <div className="Comment-date">
        {formatDate(props.date)}
      </div>
    </div>
  );
}
Posted by: Guest on November-14-2020

Code answers related to "function component example in react"

Code answers related to "Javascript"

Browse Popular Code Answers by Language