Reading notes for Code Fellows!
You don’t necessarily need a static server in order to run a Create React App project in production. It also works well when integrated into an existing server side app.
Unit testing React components that have purely presentational concerns is fairly stright-forward. But, testing more complex React components that are responsible for behavior is just as important. These include components that:
setTimeout()
setInterval()
npm run build
Do?Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
In React applications, components are the UI building blocks. They are analogous to pure functions in function composition. In React composition model is a sort of tree made up of components. Within this ‘tree’ there exist rules such as:
The components have well-defined interfaces, called ‘props’, that allow explicit interactions between them.
Vocabulary Term | Definition |
---|---|
BDD | Behavior-Driven Development. An Agile software development process that encourages collaboration among developers to formalize a shared understanding of how the application should behave. Wikipedia |
Acceptance Tests | Formal testing with respect to user needs, requirements, and business processes conducted to determine whether a system satisfies the acceptance criteria and to enable the user, customers or other authorized entity to determine whether to accept the system. Wikipedia |
mounting | The process by which React adds nodes to the DOM. (removing them from the DOM is known as “unmounting”) Stack Overflow |
build | When a user visits a site, each of the files will require an additional HTTP request, making the site slower to load. To remedy this, we can create a “build” of the app, which merges all CSS files into one file, and does the same with JavaScript. Stack Overflow |