Commit 409910ac authored by Martin Fahl's avatar Martin Fahl

adds smart and dumb components

parent 2a57956e
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class App extends Component {
render() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome to React</h1>
</header>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
</div>
);
}
}
export default App;
import React, { Component, Fragment } from "react";
import PropTypes from "prop-types";
export class InventoryList extends Component {
constructor(props) {
super(props);
this.state = {
filterTerm: "",
products: ["Water", "Bread", "Beer"]
};
}
updateFilter = event => {
this.setState({ filterTerm: event.target.value });
};
render() {
return (
<div>
<h1>HelloWorld!</h1>
</div>
);
}
}
InventoryList.propTypes = {
productList: PropTypes.array
};
import React, { Component } from 'react';
import { InventoryList } from "../../container/InventoryList/InventoryList.js";
import './App.css';
export const App = () => (
<div className="App">
<div className="App-header">
<h2>Inventory</h2>
</div>
<div className="container">
<InventoryList />
</div>
</div>
);
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import { App } from './components/presentational/App/App';
import registerServiceWorker from './registerServiceWorker';
ReactDOM.render(<App />, document.getElementById('root'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment