Sfoglia il codice sorgente

Added chapters 23, 25 and 28.

Tomi Cvetic 8 anni fa
parent
commit
63dda9cf56
1 ha cambiato i file con 30 aggiunte e 1 eliminazioni
  1. 30 1
      ReactForBeginners/Videos.md

+ 30 - 1
ReactForBeginners/Videos.md

@@ -322,4 +322,33 @@ const { details } = this.props
 	- leave
 	- appear
 
-## Video 23: Authentication
+## Video 23: Component Validation with PropTypes
+* When sharing components with other people, use PropTypes to declared what needs to be passed to them.
+
+```jsx
+const Header = function() {...}
+Header.propTypes = {
+	tagline: React.PropTypes.string.isRequired
+}
+```
+
+## Video 24: Authentication
+
+## Video 25: Building React for Production
+* If you start with create-react-app, you can use `npm build`
+* creates optimized js and css files in the `build` folder.
+* when you deploy, you need to catch the URL routing and let react-router handle URLs.
+* otherwise, on reloads serving index.html will fail.
+
+## Video 28: Deploying to Apache Server
+* Depending whether you run from the root or a subdirectory, you need to specify `<BrowserRouter basename='/somefolder'>` or not.
+* You also neet to specify this in package.json under "homepage"
+* Put the files on the server
+* in .htaccess define
+```
+RewriteBase /
+RewriteRule ^index\.html$ - [L]
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule . /index.html [L]
+```