Skip to content

Commit f0fa0cd

Browse files
committed
Add React component explicit types, new Webpack config for publicPath
1 parent 923bc59 commit f0fa0cd

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "js-stack-from-scratch",
3-
"version": "2.4.3",
3+
"version": "2.4.4",
44
"description": "JavaScript Stack from Scratch - Step-by-step tutorial to build a modern JavaScript stack",
55
"scripts": {
66
"test": "node mdlint.js"

tutorial/04-webpack-react-hmr.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ export default {
5959
'./src/client',
6060
],
6161
output: {
62-
filename: 'bundle.js',
63-
path: path.resolve(__dirname, 'dist/js'),
64-
publicPath: `http://localhost:${WDS_PORT}/dist/js/`,
62+
filename: 'js/bundle.js',
63+
path: path.resolve(__dirname, 'dist'),
64+
publicPath: isProd ? '/static/' : `http://localhost:${WDS_PORT}/dist/`,
6565
},
6666
module: {
6767
rules: [

tutorial/05-redux-immutable-fetch.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,12 @@ In this section we are going to create *Components* and *Containers*.
113113

114114
import React, { PropTypes } from 'react'
115115

116-
const Button = ({ label, handleClick }: { label: string, handleClick: Function }) =>
116+
type Props = {
117+
label: string,
118+
handleClick: Function,
119+
}
120+
121+
const Button = ({ label, handleClick }: Props) =>
117122
<button onClick={handleClick}>{label}</button>
118123

119124
Button.propTypes = {
@@ -133,7 +138,11 @@ export default Button
133138

134139
import React, { PropTypes } from 'react'
135140

136-
const Message = ({ message }: { message: string }) =>
141+
type Props = {
142+
message: string,
143+
}
144+
145+
const Message = ({ message }: Props) =>
137146
<p>{message}</p>
138147

139148
Message.propTypes = {

0 commit comments

Comments
 (0)