react-pure-decorator

Marks the react component as pure for optimized rendering

Usage no npm install needed!

<script type="module">
  import reactPureDecorator from 'https://cdn.skypack.dev/react-pure-decorator';
</script>

README

Build Status Code Climate Test Coverage Dependency Status devDependency Status

react-pure-decorator

Marks the react component as pure for optimized rendering

Installation

Run <npm install --save react-pure-decorator> and then use the default export of the module

Purpose

Pure prevents unneccesary rendering of a page

Example

Using the Pure decorator, you can attach a stylesheet to a component like this:

import {Pure} from 'decorators';

@Pure()
 export class ControlPanelLine extends Component {
 static displayName = 'ControlPanelLine';