ineffective code
export default class User extends Component {
logout() {
console.log(1)
const alert = Modal.alert
alert("", "???", [
{ text: "", onPress: () => console.log("cancel") },
{ text: "", onPress: () => {
browserCookie.erase("userid")
this.props.logoutSubmit()
}}
])
}
render() {
const props = this.props
const Item = List.Item
const Brief = Item.Brief
return props.user ? (
<div>
<Result
img={<img src={require(`../img/${props.avatar}.png`)} tyle={{ width: 50 }} alt="" />}
title={props.user}
message={props.type === "boss" ? props.company : null}
/>
<List renderHeader={()=>""}>
<Item multipleLine>
{props.title}
{props.desc.split("\n").map(v=><Brief key={v}>{v}</Brief>)}
{props.money?<Brief>:{props.money}</Brief>:null}
</Item>
</List>
<WhiteSpace></WhiteSpace>
<List>
<Item onClick={() => this.logout()}></Item>
</List>
</div>
) : <Redirect to={props.redirectTo} />
}
}
it"s a strange problem, and I don"t know why. Now it doesn"t work even if you add a click event to other files. The console neither prints nor reports an error
.