import { useState } from 'react'; import { connect } from 'react-redux' import { actionFullRegister } from '../actions' const RegistrationForm = ({ onRegistration }) => { const [login, setLogin] = useState("") const [password, setPassword] = useState("") const [passwordValidation, setPasswordValidation] = useState("") const validation = new RegExp(`^(?=.*[0-9]).{${4},}$`) return (
password must be at least 4 characters long and contain a number setLogin(e.target.value)} /> setPassword(e.target.value)} /> setPasswordValidation(e.target.value)} />
) } export const ConnectRegistrationForm = connect(null, { onRegistration: actionFullRegister })(RegistrationForm)