TypeError: t.map is not a function
{popular_tags.length > 0
? popular_tags.map((tag, index) => {
return (
<React.Fragment key={index}>
<ReactPlaceholder
showLoadingAnimation
type="textRow"
delay={2000}
ready={this.state.ready}
style={{
width: "25%",
display: "inline-block",
marginRight: 10
}}
>
<Link
to={`/tag/${tag.name}`}
className="popular_tags_item"
>
{`#${tag.name}`}
</Link>
</ReactPlaceholder>
</React.Fragment>
);
})
: null}
Failed to load http://127.0.0.1:8000/api/user/username:
Redirect from 'http://127.0.0.1:8000/api/user/username' to 'http://127.0.0.1:8000/api/user/username/'
has been blocked by CORS policy:
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://localhost:3000' is therefore not allowed access.
state = {
className: [ 'share' ]
}
handleClick = () =>{
if (this.state.className === 'share'){
this.setState({className: "share active"});
} else {
this.setState({className: 'share'});
}
}
<div className={this.state.className} >
<Link to="#" onClick={this.handleClick}>
<i className="icon-share-1"></i>
<u>Поделиться</u>
</Link>
</div>
Весь компонент