const Login extends Component {
handleRegistrationLinkClick = e => {
e.preventDefault();
this.props.setActiveForm('registration');
};
render() {
return (
<div>
<div>Login</div>
<div>
<a className='reg' onClick={this.handleRegistrationLinkClick}>or Register</a>
</div>
</div>
);
}
}
Такая конструкция не является избыточной?
const setNumber = event => ({ type: 'SET_NUMBER', payload: event.target.value });
{
onSetNumber: setNumber,
}
withRouter(connect(...)(MainLayout));
Component extends React.Component {
state = initialState;
}
(function foo() {
alert('foo');
})();
foo(); // Uncaught ReferenceError: foo is not defined