Answers for "function props"

C
1

function component with props

import React from "react"

function Checkbox(props){
    return (
        <div>
            <input type="checkbox" />
            <label>{props.value}</label>
        </div>
    )
}

export default Checkbox
Posted by: Guest on April-13-2021
0

props in functions

// Component.js

// props - объект, передаётся как аргумент функции
function MyComponent(props) {

    return (
        <div className="MyComponent">
            {/* Используются свойства объекта props */}
            Hello, {props.name}!
        </div>
    );
}

export default MyComponent;
Posted by: Guest on December-01-2021

Code answers related to "C"

Browse Popular Code Answers by Language