component-slider
Version:
used to show react components in carousal format
46 lines (38 loc) • 1.12 kB
JavaScript
import React, { Component, PropTypes } from 'react';
import emptyFunction from 'fbjs/lib/emptyFunction';
import { Provider } from 'react-redux';
import AppContainer from '..//AppContainer';
class App extends Component {
static propTypes = {
context: PropTypes.shape({
store: PropTypes.object.isRequired,
insertCss: PropTypes.func,
setTitle: PropTypes.func,
setMeta: PropTypes.func,
}).isRequired,
children: PropTypes.element.isRequired,
error: PropTypes.object,
};
static childContextTypes = {
insertCss: PropTypes.func.isRequired,
setTitle: PropTypes.func.isRequired,
setMeta: PropTypes.func.isRequired,
};
getChildContext() {
const context = this.props.context;
return {
insertCss: context.insertCss || emptyFunction,
setTitle: context.setTitle || emptyFunction,
setMeta: context.setMeta || emptyFunction
};
}
render() {
const store = this.props.context.store;
return (
<Provider store={store}>
<AppContainer children={this.props.children} />
</Provider>
);
}
}
export default App;