Section 26: Create React App and Props Flashcards
1
Q
Webpack
A
A module bundler for modern JavaScript applications
- Combines different JS files into a bundle.js
- Has plugin system to run tools like babel
- Also bundles other assets like css, images, etc
2
Q
React Props
A
immutable data passed to your components. They are accessible in your component as an object called this.props
3
Q
defaultProps
A
*provides a default so that the rest of your code doesn’t break because it’s undefined.
4
Q
static defaultProps
A
*This way it is static an doesn’t get created multiple times. ** I think?
5
Q
propTypes
A
*Development time checker for your props. Only works on development mode. Used to check for mistakes in the code.
Installation:
npm install –save prop-types
*Used to alert when there’s a bug floating around in development.