import {useState} from "react"; import {history} from "../../App"; import {connect} from "react-redux"; import {actionFullReg} from "../../actions"; const RegForm = ({ onReg }) => { const [l, setL] = useState(""); const [p, setP] = useState(""); const [p2, setP2] = useState('') return (
setL(e.target.value)}> setP(e.target.value)}>
{p.length < 6 ? 'Короткий пароль' : 'Хороший пароль'}
setP2(e.target.value)}>
{p === p2 ? 'Пароли совпадают' : 'Пароли не совпадают'}
); }; export const CRegForm = connect(null,{onReg: actionFullReg}) (RegForm)