Class-27 Reading: Props and State
Class-27 Reading: Props and State
Table of Contents
Reading, Research, and Discussion
1. Does a deployed React application require a server?
- If you mean backend server, then no, you do not need a back-end server because you can run a build and serve a static website.
- But it still require a SaaS solution like Heroku or even more complex PasS or IaaS to deploy the React Application to, if you consider that as a “front-end server”.
2. Why do we prefer to test a React application at the behavior rather than the unit level?
- Behaviors are a constant. As they should always do the same thing based on the logic, while the outcome might be different based on the state of the application.
3. What does npm run build do?
- Build will condense the applications code and get it ready for production level deployment
4. Describe the actual composition / architecture of a React application
- Components are made, then rendered to a virtual “DOM”, old VDOM and new VDOM is compared, then real DOM is rendered. Next UI is added. A server if required wil feed the components.
Vocabulary Terms
BDD
:
- def: Behavior-driven Development, This is the practice of writing tests around the behavior of an application.
Acceptance Tests
:
- def: These tests are designed to ensure an application has met a minimum requirement. It must pass these tests to be accepted.
mounting
:
- def: Mounting in React World refers to when a component is “mounted” to the DOM , OR, that component is rendered to the DOM.
build
:
- def: Build is a common script, that when ran will create a build directory with a production build of the application
Additional Resources
Bookmark / Skim