YP
Size: a a a
YP
VV
VV
VV
aa
aa
A
class PhoneSignInMutation extends Mutation<startPhoneVerification, startPhoneVerificationVariables> {}Ошибка на слове Mutation первого класса
class PhoneLogin extends React.Component<RouteComponentProps<any>, IState> {
public render() {
const { history } = this.props;
const { countryCode, phoneNumber } = this.state;
return (
<PhoneSignInMutation>
{(phoneMutation, { loading }) => {
this.phoneMutation = phoneMutation;
return (
<PhoneLoginPresenter
countryCode={countryCode}
phoneNumber={phoneNumber}
onInputChange={this.onInputChange}
onSubmit={this.onSubmit}
loading={loading}
/>
);
}}
</PhoneSignInMutation>
);
}
}
Type 'typeof Mutation' is not a constructor function type.
а еще <PhoneSignInMutation>TS2786: 'PhoneSignInMutation' cannot be used as a JSX component. Its instance type 'PhoneSignInMutation' is not a valid JSX element. Type 'PhoneSignInMutation' is missing the following properties from type 'ElementClass': render, context, setState, forceUpdate, and 3 more.
aa
aa
B1
B1
СЖ
<Header onClickLinks={(name) => alert(name)} links={[
'Главная', 'О нас', 'Команда', 'Каталог'
]}/>
const Header = ({links, onClickLinks}) => {
const state = useState(null)
const activeLink = state[0]
const setActiveLink = state[1]
<ul className="header-menu">
{
links.map((name, index) => (
<li className = {`header-menu__item ${activeLink === index ? 'header- menu__item_active' : ''}`} onClick={() => setActiveLink(index)} key={name}>
<a href='/'>{name}</a>
</li>
))
}
}
этот код добавляет класс активности лишке на которую я кликнул, но потом обновляется страничка и сразу этот класс активности убирается<li className="header-menu__item header-menu__item_active"><a href={HOME_ROUTE}>Главная</a></li>
В
АП
В
В
АП
В