React functional component with props

    0

    14

    Jose Romero

    createfunctionalreactβ€’β€’β€’
    React JavaScript Recipes

    The above code will return a DOM element with the specified class name.

    Library: react

    Shortcut: react.component.functional.props.create

    import React from "react";
    import PropTypes from "prop-types";
    
    const filename = (props) => {
      const {
      // Deconstruct props here
      } = props;
      return (<div className={props.className}></div>);
    };
    filename.propTypes = {
      className: PropTypes.string
    }
    export default filename;
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.