New component
Created a new component and placed it in the DOM.
This commit is contained in:
parent
cc77442f71
commit
1a6ac71d5b
|
@ -1,9 +0,0 @@
|
||||||
import React, { Component } from 'react';
|
|
||||||
|
|
||||||
export default class App extends Component {
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<div>React simple starter</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
19
src/index.js
19
src/index.js
|
@ -1,15 +1,14 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import { Provider } from 'react-redux';
|
|
||||||
import { createStore, applyMiddleware } from 'redux';
|
|
||||||
|
|
||||||
import App from './components/app';
|
// Create a new component. This component should produce
|
||||||
import reducers from './reducers';
|
// some HTML
|
||||||
|
const App = () => {
|
||||||
|
return <div>Hi!</div>;
|
||||||
|
}
|
||||||
|
|
||||||
const createStoreWithMiddleware = applyMiddleware()(createStore);
|
// App = function() similar to App = () =>
|
||||||
|
|
||||||
ReactDOM.render(
|
// Take this component's generated HTML and
|
||||||
<Provider store={createStoreWithMiddleware(reducers)}>
|
// put it on the page (in the DOM)
|
||||||
<App />
|
ReactDOM.render(<App />, document.querySelector('.container'));
|
||||||
</Provider>
|
|
||||||
, document.querySelector('.container'));
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
import { combineReducers } from 'redux';
|
|
||||||
|
|
||||||
const rootReducer = combineReducers({
|
|
||||||
state: (state = {}) => state
|
|
||||||
});
|
|
||||||
|
|
||||||
export default rootReducer;
|
|
Loading…
Reference in New Issue