React Fast Mount
Live Example
Fast mount slow loading components for improved responsiveness and perceived performance. This allows a site to respond instantly to user input, even if it is to show a blank screen while the component is loading, so the site is perceived as fast and responsive.
The difference is most noticeable on mobile devices, especially slower devices.
Usage
React Fast Mount is a high order component (HOC) - just wrap your component in the
Fast Mount function before export, e.g. export default fastMount(MyComponent);
.
$ yarn add react-fast-mount
# OR
$ npm install --save react-fast-mount
import React from 'react';
import fastMount from 'react-fast-mount';
class MyComponent extends React.Component {
...
render() {
...
}
}
export default fastMount(MyComponent);
export default fastMount(MyComponent, <div style={{ height: '200px' }} />)