import React from "react";
const ImageList = ({ urlList }) => {
const list = urlList.map(url => {
return (
<li key={url}>
{url}
<img src={url} alt="" />
</li>
);
});
return <ul>{list}</ul>;
};
export default ImageList;
import ImageList from "../components/ImageList";
import { connect } from "react-redux";
const mapStateToProps = state => {
return {
urlList: state.imageUrls
};
};
export default connect(mapStateToProps, null)(ImageList);
import React from "react";
import ImageList from "./containers/ImageList";
const App = () => {
return (
<div>
App
<ImageList />
</div>
);
};
export default App;