function component in react
// function component in react
import React from 'react';
const FunctionComponent = function() {
return (
<div>
<h1>React Function Component</h1>
</div>
)
}
export default FunctionComponent;
function component in react
// function component in react
import React from 'react';
const FunctionComponent = function() {
return (
<div>
<h1>React Function Component</h1>
</div>
)
}
export default FunctionComponent;
defining functions in react
export default class Archive extends React.Component {
saySomething(something) {
console.log(something);
}
handleClick(e) {
this.saySomething("element clicked");
}
componentDidMount() {
this.saySomething("component did mount");
}
render() {
return <button onClick={this.handleClick.bind(this)} value="Click me" />;
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us