resau
Version:
React 16.3's new [Context API](https://reactjs.org/docs/context.html) is very promising. Who knows that in the future we're no longer need the likes of Redux for our app's state management? For more information, [this article](https://medium.freecodecamp.
28 lines (25 loc) • 636 B
JavaScript
import React from "react";
import randomColor from "randomcolor";
import { DetailButtons } from "./../../components";
class Detail extends React.Component {
shouldComponentUpdate() {
return false;
}
goBack() {
this.props.history.push("/");
}
render() {
console.log('not');
return (
<div className="transition-item detail-page">
<DetailButtons />
<div onClick={this.goBack.bind(this)}>
<p style={{ padding: 10, backgroundColor: randomColor() }}>
This is an Item. Click here to go back.
</p>
</div>
</div>
);
}
}
export default Detail;