This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const UppercaseHoC = (WrappedComponent) => (props) => | |
| <div style="text-transform: uppercase;"> | |
| <WrappedComponent {...props}/> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| componentWillReceiveProps( nextProps, nextContext) | |
| shouldComponentUpdate(nextProps,nextState,nextContext) | |
| componentWillUpdate(nextProps,nextState,nextContext) | |
| componentDidUpdate(prevProps,prevState,prevContext) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Greeting = (props,context) => <p style={context.style}>Hello World</p> | |
| Greeting.contextTypes = { | |
| color: React.PropTypes.string, | |
| backgroundColor: React.PropTypes.string, | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {Component, PropTypes} from 'react'; | |
| import getMuiTheme from './getMuiTheme'; | |
| class MuiThemeProvider extends Component { | |
| static propTypes = { | |
| children: PropTypes.element, | |
| muiTheme: PropTypes.object, | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default class Provider extends Component { | |
| getChildContext() { | |
| return { store: this.store } | |
| } | |
| constructor(props, context) { | |
| super(props, context) | |
| this.store = props.store | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class App extends React.Component{ | |
| render = () => <div className="app">{this.props.children}</div> | |
| } | |
| class Greeting extends React.Component{ | |
| render = () => <p style={this.context.style}>Hello world!</p> | |
| } | |
| Greeting.contextTypes = { | |
| color: React.PropTypes.string, | |
| backgroundColor: React.PropTypes.string | |
| } |
NewerOlder