preact-pure-props
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

preact-pure-props npm version

It is a little different from the PureComponent of preact.

First, compare only the props. If the state does not change, do not re-render.

However, if the update does not change only through setState, it also re-render.

Installation

npm

$ npm install preact-pure-props

How to use

import PureProps from "preact-pure-props";

class Component extends PureProps<{}, {}> {
    public render() {
        return (
            <div />
        );
    }
}

License

MIT License

Copyright (c) 2019 Daybrush

Package Sidebar

Install

npm i preact-pure-props

Weekly Downloads

2

Version

0.1.4

License

MIT

Unpacked Size

13.3 kB

Total Files

17

Last publish

Collaborators

  • younkue