Answer the question
In order to leave comments, you need to log in
How to check props?
const MainHeader = (props) => {
let data = {};
if (props){
let data = this.props
}
else{
data = {
work: "",
schedule: "",
supportEmail: "",
menu:[
{
url: '',
label: 'В кабинет',
target: '_self'
},
{
url: '',
label: 'Зарегистрироваться',
target: '_self'
}
]
}
}
return (
<header className="row store-header">
<div className="col-md-12 store-header__top-info">
<div className="row">
<div className="col-md-2"></div>
<div className="col-md-8">
<div className="row">
<div className="store-header__top-info-left-col col-md-8">
<span className="store-header__work">
Работаем: ПН-СБ <span>9.00-19.00</span>
</span>
<span className="store-header__support">
<a href="mailto:"></a>
</span>
</div>
<div className="store-header__top-info-right-col col-md-4">
<span>
<NavLink to="/office">В кабинет</NavLink>
или
<NavLink to="/registration/register">Зарегистрироваться</NavLink>
</span>
</div>
</div>
</div>
<div className="col-md-2"></div>
</div>
</div>
</header>
);
}
export default MainHeader;
Answer the question
In order to leave comments, you need to log in
Install prop-types and follow instructions: https://ru.reactjs.org/docs/typechecking-with-prop...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question