Open martinandersen3d opened 6 years ago
Video 5 - PropTypes Notes:
https://reactjs.org/docs/typechecking-with-proptypes.html
Note: React.PropTypes has moved into a different package since React v15.5. Please use the prop-types library instead. We provide a codemod script to automate the conversion.
https://www.npmjs.com/package/prop-types
npm install --save prop-types
import PropTypes from 'prop-types'; // ES6
var PropTypes = require('prop-types'); // ES5 with npm
example:
Home.propTypes = {
age: PropTypes.number,
user: PropTypes.object
};
Video 1/2/3: https://www.youtube.com/watch?v=G40iHC-h0c0&list=PL55RiY5tL51oyA8euSROLjMFZbXaV7skS&index=4
This works in 2018, webpack 4:
webpack.config.js
package.json
dist/index.html
npm start See: http://localhost:8080/
This is inspiration from: github.com/rwieruch/minimal-react-webpack-babel-setup