that's the React logo!
shouldComponentUpdate()
You should watch this: https://www.youtube.com/watch?v=-DX3vJiqxm4
* Well-written React Components
Shared mutable state is the root of all evil
- Lots of people
shouldComponentUpdate()
Object-oriented programming is an exceptionally bad idea which could only have originated in California
- Edsger W. Dijkstra
class MyComponent extends React.Component {
render() {
return <div>Stuff with {this.props.aProp}</div>
}
}
class MyOtherMorePowerfulComponent extends MyComponent {
render() {
super();
...[i don't even know what to do here cuz it's bad and I don't do bad stuff].
}
}
class MyComponent extends React.Component {
render() {
return <div>Stuff with {this.props.aProp}</div>
}
}
export default wrapComponent(MyComponent);
function wrapComponent(component) {
return class MyHOC extends React.Component {
render() {
return <MyComponent anotherPropINeedToSend="blah!" {...this.props} />
}
}
}
May be impossible with their current architectures, but I'm not sure.
React.createElement(props, [child, child...])
Another video to watch, yay!
not the actual Gibson logo. Couldn't find that. This ones cooler cuz it's from Family Guy.
return React.createElement(
ReactTHREE.Scene,
{
width: window.innerWidth,
height: window.innerHeight,
camera: 'camera',
antialias: true,
background: 0xEEEEEE
},
CameraElement,
RobotRobbyElement,
RobotMechElement,
AmbientLight,
DirectionalLight
)