npm.io
0.1.4 • Published 7 years ago

preact-pure-props

Licence
MIT
Version
0.1.4
Deps
1
Size
13 kB
Vulns
0
Weekly
0
Stars
2

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

Keywords