p5.js-web-editor/shared/containers/App/App.jsx

27 lines
601 B
React
Raw Normal View History

2016-05-05 23:01:31 +00:00
import React from 'react';
import Editor from '../../components/Editor/Editor'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as FileActions from '../../redux/actions'
class App extends React.Component {
render() {
return (
<Editor
content={this.props.file.content}
updateFile={this.props.updateFile}/>
);
}
}
function mapStateToProps(state) {
return {
file: state.file
}
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(FileActions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(App);