View index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import Search from "../../components/Search"; | |
class SearchContainer extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
value: "", | |
articles: [] | |
}; |
View index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
const SearchResult = props => { | |
return ( | |
<ul> | |
<li> | |
<a href={props.result.webUrl} target="_blank"> | |
{props.result.webTitle} | |
</a> | |
</li> |
View index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import SearchResult from "../SearchResult"; | |
const Search = props => { | |
return ( | |
<div> | |
<h1>The Guardian Search App</h1> | |
<form onSubmit={props.handleSubmit}> | |
<input | |
type="text" |
View Search.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import SearchResult from "../SearchResult"; | |
const Search = props => { | |
return ( | |
<div> | |
<h1>The Guardian Search App</h1> | |
<form onSubmit={props.handleSubmit}> | |
<input | |
type="text" |
View Search.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import SearchResult from "./SearchResult"; | |
export class Search extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
value: "", | |
articles: [] |
View Search.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
export class Search extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
value: "", | |
articles: [] | |
}; |
View webpack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const HtmlWebPackPlugin = require("html-webpack-plugin"); | |
const htmlWebpackPlugin = new HtmlWebPackPlugin({ | |
template: "./src/index.html", | |
filename: "./index.html" | |
}); | |
module.exports = { | |
module: { | |
rules: [ |
View webpack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const HtmlWebPackPlugin = require("html-webpack-plugin"); | |
const htmlWebpackPlugin = new HtmlWebPackPlugin({ | |
template: "./src/index.html", | |
filename: "./index.html" | |
}); | |
module.exports = { | |
module: { | |
rules: [ |
View index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import ReactDOM from "react-dom"; | |
const Index = () => { | |
return <div>Hello React!</div>; | |
}; | |
ReactDOM.render(<Index />, document.getElementById("index")); |
View webpack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const HtmlWebPackPlugin = require("html-webpack-plugin"); | |
const htmlPlugin = new HtmlWebPackPlugin({ | |
template: "./src/index.html", | |
filename: "./index.html" | |
}); | |
module.exports = { | |
module: { | |
rules: [ |
NewerOlder