Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save bedirhankaradogan/87ce4256fcf9be3f7f65a0fd67c800e9 to your computer and use it in GitHub Desktop.

Select an option

Save bedirhankaradogan/87ce4256fcf9be3f7f65a0fd67c800e9 to your computer and use it in GitHub Desktop.
import React from "react";
import ReactDOM from "react-dom";
const FunctionalComponentWithProps = (props) => {
const fullName = `${props.name} ${props.surname}`;
const handleClick = (event) => {
alert(fullName);
};
return (
<div onClick={handleClick}>
{`Hello ${fullName}`}
</div>
);
};
const RenderFunctionalComponents = () => {
return <FunctionalComponentWithProps name={"Bedirhan"} surname={"Karadoğan"} />;
};
const rootElement = document.getElementById("root");
ReactDOM.render(<RenderFunctionalComponents />, rootElement);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment