Much of the information in this article comes from MDN. You can go to the further reading section for more details.
A BFC(block formatting context) is a mini layout system on your page. Everything in the BFC will not interfere with the outer world.
It is worth mentioning that a…
What is React component lifecycle? You can think of the lifecycle as the different stages of a component from birth to death.
It is called before mounting the component into DOM.
It is the place where you initialize the local state and binds event methods.
The render method…
React hooks hook out great features of react for your to use in functional components.
Hooks are functions that hook into react state and lifecycle features from the function component. It does not work in class components.
It sounds odd, but the theory is pretty simple.
Lets’s take a look at how debounce and throttle works first.
This a pretty simple realization of debounce and throttle. In the product environment, you should use Lodash or other similar strictly library.
There are couple of types of XSS: reflected, stored, dom-based, and mutation XSS.
First, one is reflected XSS, which simply reflected script tags in the response. …
HTTP devices can keep copies of popular documents. Maintaining a cache of the previous resources allows the client to use a local copy of the resource, thereby eliminating unnecessary HTTP requests.
Normally, making an HTTP cache is about three HTTP headers: Cache-control, Last-modified, and Etag. …
Middleware, a extra step where async logics run.
Redux store itself don’t know anything about async logic. It only knows how to synchronously dispatch actions, update the state by calling the root reducer, and notify the ui which needs to be updated. Any asynchronicity happen outside the store.
The React docs state:
In a controlled component, form data is handled by a React component. The alternative is uncontrolled components, where form data is handled by the DOM itself.
Form elements, includes input, select, text area. …